Level 2
SOLUTION:
Seems like MySQL mode was set to strict, from the laravel fresh installation
To solve it; go to config/database.php
'mysql' => [
//...
'strict' => false,
],
2 likes
hello, I used to insert data in the database that sometimes was not full, for example;
$user = new App\User;
$user->email = '[email protected]';
$user->password = \Crypt::encrypt('test');
$user->save();
This now fails so badly giving me a non-sense SQL (the SQL is trying to insert data i did not even want to and of course it's not set)
SQLSTATE[HY000]: General error: 1364 Field 'name' doesn't have a default value (SQL: insert into `users` (`email`, `password`, `updated_at`, `created_at`) values ([email protected], eyJpdiI6Ikc0eHV3bzBPZFZFQVdYd2Jwd1dDSXc9PSIsInZhbHVlIjoiZzVPbkVzazhFRE9xbnZCSnZEdkI0dz09IiwibWFjIjoiZjQ0MTUyNzY4ZWVkOGUxYWNmYmJiM2UzMmQ3N2YzMjEzZGExZjNlMjdiMzJlNDliYzU3OWNmNTE3ODgwMmZjMiJ9, 2016-08-27 00:47:06, 2016-08-27 00:47:06))
Any solutions?
SOLUTION:
Seems like MySQL mode was set to strict, from the laravel fresh installation
To solve it; go to config/database.php
'mysql' => [
//...
'strict' => false,
],
Please or to participate in this conversation.