A
A
Alexey Babiev2018-02-02 20:34:07
Laravel
Alexey Babiev, 2018-02-02 20:34:07

How to specify a specific date by default for the timestamp field in laravel migration?

I am preparing migrations for a project on Laravel 5.4, there was a need to set the default value for the timestamp field at 2038-01-19 03:14:06
I don’t want to perform migration for the sake of samples with a finger to the sky, but I don’t have enough experience.
$table->timestamp('expires_at')->default(???);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Babiev, 2018-02-03
@axsmak

The correct solution was to simply pass the default value as a string.
Everything is simple in Laravel. As always

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question