$table->timestamps() refer to 'created_at' and 'updated_at'
try
$table->timestamp('published_at')->nullable()
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi .. i'm using $table->timestamps('published_at')->nullable() in migrations, and i got an error that nullable() on null. @jeffry in larcasts laravel6 migration 101 uses this code .. but i got nullable() on null error. nullable() method does not work in timestamps(). why ??
Jeffrey does not use your code. He has timestamps() and then an extra line for timestamp(). Note that these are different functions. you need both lines.
$table->timestamps();
$table->timestamp('published_at')->nullable();
ignore @munazzil , he's inventing his own unrelated problems again
Please or to participate in this conversation.