Laravel-admin入门到放弃

各种报错

运行php artisan admin:install报错

  • 具体错误信息
Illuminate\Database\QueryException  : SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table `role_user` add constraint `role_user_user_id_foreign` foreign key (`user_id`) references `users` (`id`) on delete cascade on update cascade)
  • 错误原因
    外键类型不一致
  • 解决办法
    create_users_table.php 第17行改为$table->increments(‘id’);

在http://localhost:8080/admin/auth/users添加用户时报错

  • 具体错误信息
Disk [admin] not configured, please add a disk config in `config/filesystems.php`.
  • 解决办法
    config/filesystems.php的disks数组中添加以下代码
      'admin' => [
            'driver'     => 'local',
            'root'       => public_path('upload'),
            'visibility' => 'public',
            'url' => env('APP_URL').'/upload/',
        ],

基本设置

设置登录界面背景图

  • 文件:config/admin.php
  • 286行

设置文字

Dashboard题目

  • 文件:/vendor/encore/laravel-admin/resources/views/dashboard/title.blade.php
  • 29行

语言修改

  • 文件:config/app.php
  • 83行,修改为'locale' => 'zh-CN',

时区修改

  • 文件:config/app.php
  • 70行,修改为'timezone' => 'PRC',

头像修改

猜你喜欢

转载自blog.csdn.net/qq_42094066/article/details/90698559
今日推荐