Laravel-admin 后台添加商品中、bootstrap.php 中把 editor 禁用解除

laravel-admin后台添加商品中、app/Admin/bootstrap.php 中把这个禁用解除了、还是显示 Field type [editor] does not exist、为啥不生效呢?phpstrom编辑器中$form->edito('description', '商品描述')->rules('required');
editor这个方法也是提示不存在

《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
wangchunbo
最佳答案

你可以安装wang-editor。然后配置即可。
我的app\Admin\bootstrap.php

use App\Admin\Extensions\WangEditor;
use Encore\Admin\Form;

Form::extend('editor', WangEditor::class);

详情参考这里:https://laravel-admin.org/docs/zh/model-fo...

报错没有配置文件
file

Disk [admin] not configured, please add a disk config in
config/filesystems.php.

添加配置文件
在config/filesystems.php中添加:

'disks' => [

    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
    ],

    'public' => [
        'driver' => 'local',
        'root' => storage_path('app/public'),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
    ],

    's3' => [
        'driver' => 's3',
        'key' => env('AWS_KEY'),
        'secret' => env('AWS_SECRET'),
        'region' => env('AWS_REGION'),
        'bucket' => env('AWS_BUCKET'),
    ],
    // 添加的代码
    'admin' => [
        'driver'     => 'local',
        'root'       => public_path('upload'),
        'visibility' => 'public',
        'url' => env('APP_URL').'/public/upload/',
    ],

file

4年前 评论
curry丶 (楼主) 4年前
wangchunbo (作者) 4年前
讨论数量: 4

file
我没有安装这个composer require encore/laravel-admin "1.6.11"、
我安装的是这个composer require encore/laravel-admin、后面没有加版本就默认最新的吗?

4年前 评论
leo

请用课程指定的版本

4年前 评论
wangchunbo

你可以安装wang-editor。然后配置即可。
我的app\Admin\bootstrap.php

use App\Admin\Extensions\WangEditor;
use Encore\Admin\Form;

Form::extend('editor', WangEditor::class);

详情参考这里:https://laravel-admin.org/docs/zh/model-fo...

报错没有配置文件
file

Disk [admin] not configured, please add a disk config in
config/filesystems.php.

添加配置文件
在config/filesystems.php中添加:

'disks' => [

    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
    ],

    'public' => [
        'driver' => 'local',
        'root' => storage_path('app/public'),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
    ],

    's3' => [
        'driver' => 's3',
        'key' => env('AWS_KEY'),
        'secret' => env('AWS_SECRET'),
        'region' => env('AWS_REGION'),
        'bucket' => env('AWS_BUCKET'),
    ],
    // 添加的代码
    'admin' => [
        'driver'     => 'local',
        'root'       => public_path('upload'),
        'visibility' => 'public',
        'url' => env('APP_URL').'/public/upload/',
    ],

file

4年前 评论
curry丶 (楼主) 4年前
wangchunbo (作者) 4年前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!