laravel 常见问题

时间:2021-05-15 04:52:13

1、 Specified key was too long; max key length is 767 bytes

处理: 修改config/database.php , mysql配置。删除数据库表,再执行 php artisan migrate

'charset' => 'utf8',
'collation' => 'utf8_unicode_ci' ,

2、 Auth guard [admin] is not defined.

处理:修改config/auth.php配置。

'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'admin' => [
'driver' => 'session',
'provider' => 'admins',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
],
],