I know how to use date and dateTime. But in this case I want my data to be like 2023-03-03 Friday. Does laravel provides something like this?
this is my code
$table->date('estimate_time_arrival');
how can i modify it?
I know how to use date and dateTime. But in this case I want my data to be like 2023-03-03 Friday. Does laravel provides something like this?
this is my code
$table->date('estimate_time_arrival');
how can i modify it?
2
Answers
You can use the timestamp or datetime column type in your migration to store the date and time information.
THen for diplay you can do something like…
You can store values as dateTime in the database and then use model casts like this:
You can read more about date casting and other types of casting here