Reputation: 131
I have a table that contains boolean fields with default value.
$table->boolean('status')->default(false);
but it gives this error when my input is null : "Column 'status' cannot be null".
I thought that if the input is null, db set status false as default. Should I use nullable? but this time 'status' field will be null not false.
validation:
'form.status' => 'nullable',
Upvotes: 0
Views: 513
Reputation: 468
try php artisan migrate:fresh
and insert into the form again
if it doesn't work use $table->boolean('status')->default(false)->nullable()
Upvotes: 2