雪软/php-editor

基于 code-mirror 的 Laravel-admin PHP 编辑器扩展

v1.0.4 2023-01-27 11:13 UTC

This package is auto-updated.

Last update: 2024-09-27 14:36:40 UTC


README

DEMO (使用 admin/admin 登录)

安装

composer require snowsoft/php-editor

php artisan vendor:publish --tag=laravel-admin-code-mirror

配置

config/admin.php 文件的 extensions 部分中,添加属于此扩展的一些配置。

    'extensions' => [

        'php-editor' => [
        
            //Set to false if you want to disable this extension
            'enable' => true,
            
            // Editor configuration
            'config' => [
                
            ]
        ]
    ]

编辑器的配置可以在 CodeMirror 文档 中找到

使用方法

以以下形式使用

$form->php('code');

设置高度

$form->php('code')->height(500);

许可协议

遵循 MIT 许可协议 (MIT)