close

[Solved] SQLSTATE[HY000]: General error: 1364 Field ‘name’ doesn’t have a default value laravel 5.5

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error SQLSTATE[HY000]: General error: 1364 Field ‘name’ doesn’t have a default value laravel 5.5 in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How SQLSTATE[HY000]: General error: 1364 Field ‘name’ doesn’t have a default value laravel 5.5 Error Occurs?

Today I get the following error SQLSTATE[HY000]: General error: 1364 Field ‘name’ doesn’t have a default value laravel 5.5 in php.

How To Solve SQLSTATE[HY000]: General error: 1364 Field ‘name’ doesn’t have a default value laravel 5.5 Error ?

  1. How To Solve SQLSTATE[HY000]: General error: 1364 Field 'name' doesn't have a default value laravel 5.5 Error ?

    To Solve SQLSTATE[HY000]: General error: 1364 Field 'name' doesn't have a default value laravel 5.5 Error The error occurs due to the strict mode of MYSQL5.7. Please change your config/database.php in the connections.mysql section by putting 'strict' => false.

  2. SQLSTATE[HY000]: General error: 1364 Field 'name' doesn't have a default value laravel 5.5

    To Solve SQLSTATE[HY000]: General error: 1364 Field 'name' doesn't have a default value laravel 5.5 Error The error occurs due to the strict mode of MYSQL5.7. Please change your config/database.php in the connections.mysql section by putting 'strict' => false.

Solution 1

This is late answer for this question, but it might help for others. This error can be occurred due to error in $fillable data in modal. You can try using

protected $guarded = []

instead of

protected $fillable = [
    'name',
    'city',
    'suburb',
    'street',
    'o_number',
    'i_number',
    'postal_code',
    'phone_s',
    'email_s',
    'google_map',
    'customer_id'
];

Solution 2

The error occurs due to the strict mode of MYSQL5.7. Please change your config/database.php in the connections.mysql section by putting ‘strict’ => false.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment