M
M
Mokhirjon Naimov2016-06-21 00:04:59
MySQL
Mokhirjon Naimov, 2016-06-21 00:04:59

How to remove on update property from TIMESTAMP column in Laravel?

In migration he wrote:

$table->timestamp('publish_at');
$table->timestamps();

But it turned out that `publish_at` is automatically updated when the model is updated. From phpmyadmin :
75978fb84e.jpg
How to specify in migrations not to automatically update `published_at`?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mokhirjon Naimov, 2016-06-25
@zvermafia

I solved it simply:
$table->timestamp('publish_at')->nullable();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question