I have date fields on my form, but these fields are optional. When I fill in a date the registration is successful, but if I leave the empty date field I get the following error:
SQLSTATE[22007]: Invalid datetime format: 7 ERROR: invalid input syntax for type date: "" (SQL: insert into...
The same happens when I leave a blank field of type (residence number for example), it seems that the postgre does not accept that it is left blank, I know the ...
By the way, the fields were created as null:
$table->date('nascimento')->nullable();
I'm using laravel 5.1 with postgresql. Someone gives me a light?