Laravel 9 Migration How To Set Date Default Value ? #45937
Unanswered
bhargavraviya
asked this question in
Q&A
Replies: 2 comments 2 replies
-
You want an actual static date to be default, or now on create / update? |
Beta Was this translation helpful? Give feedback.
0 replies
-
If you catch current date for record new line on database you can use observers or mutators in model. Or you can set function with DB:statement in your migration up method. But best is with mutators. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In Laravel Migration how to set the date default value?
$table->date('date')->default(?);
Beta Was this translation helpful? Give feedback.
All reactions