mysql - Laravel 4.2: Eloquent is creating insert queries with NULL values -


mysql version 5.6. community edition. laravel 4.2 eloquent creating insert queries null values due getting "sqlstate[23000]: integrity constraint violation:" error.

is there way make eloquent replace null values empty strings? or make laravel queries strict mode compliant?

i have turned strict mode of mysql , still getting error. have tried 'strict'=>true/false in database config file no luck.

any appreciated.

for this, did was:

if field has default value of current_timestamp, set datatype timestamp('field_name'), if doesnt have current_timestamp default value, set datatype datetime , set nullable().

//for timestamp $table->timestamp('create_datetime')->default(db::raw('current_timestamp'));  //for datetime $table->datetime('start_datetime')->nullable(); 

hope helps.


Comments