报错信息
laravel which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
关闭严格模式:
修改 app/database.php 文件中 mysql 参数,改动如下:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => false, //重点是这里
'engine' => null,
],