1
I have a field $table->enum('situacao', ['ativo', 'exonerado']);
.
I created a checkbox to register, but it returns the following error:
1048 Column 'situation' cannot be null.
How can I solve?
The checkbox looks like this:
{!! Form::checkbox('situacao', '1') !!}
Already the catch is like this:
$civil = new civil;
$civil->situacao = $request->situacao;
$civil->save();
Gives this error only when the checkbox is not checked?
– Sam
You can start with a preselected checkbox, and only allow changing the selection by not allowing everyone to be unchecked
– Mateus
Worked? .......
– novic