1
I have date fields in my form, but these fields are optional. When I fill in a date the registration is successfully performed, but if I leave the date field empty 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 field of the whole type blank (residence number for example), it seems that the postgre does not accept that it is left blank, sei la...
By the way, the fields were created as null:
$table->date('nascimento')->nullable();
I’m using Portable 5.1 with postgresql. Someone give me a light?
For pass int fields
0
as standard value, andnull
or current date for date type fields.– rray
blz, I’m gonna test here @rray
– Raylan Soares
Ball show, it worked! Thanks @rray
– Raylan Soares
Postgres is a little boring in some things but it has cool features as well. Create an answer to help others solve this problem :)
– rray