Mass assignment won't handle Null input even when default is set on migration.Any solution to this?
问题 I have been using mass assignment a lot. I recently came across this issue, where I create fillable, and also defaults for null values, but on using mass assignment, if my inputs are empty, it returns a "Cannot Be Null" Error. My Model protected $fillable = ['name','status']; My Controller $this->model->create($request->all()); My Migration $table->boolean('status')->default(0); Shouldn't the above mean that when I provide nothing on the input field status , it should default to 0? But column