@yhassoun maybe you forgot to add it to fillable props?
Nov 21, 2021
8
Level 1
Date stores as null in mysql
I am storing date in this format: yyyy-mm-dd I also tried with yyyy-mm-dd hh:mm:ss using date and strtotime functions in a livewire component. I can read the variable with no issues if I dd with this format, but once I write it to mysql db it is stored as null: date('Y-m-d', strtotime($this->date)) I tried field type in db to be DATETIME as well as TIMESTAMP, both with no luck. What am I doing wrong?
Level 1
The problem was in the format I entered, it was not correct. It should be:
formated_deadline = date('Y-m-d H:i:s', strtotime($this->close_date))
That solved it :)
Please or to participate in this conversation.