laravel 插入数据报错 doesn’t have a default value 

laravel-mysql-默认为严格的验证方式

Tip: 在Config/database.php中设置’strict’ => false

'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' => fasle,
    'engine' => null,
],

相关资料

laravel中mysql默认使用了严格的验证方式

发表评论