Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

abkrim's avatar
Level 13

nullable() > Call to a member function useCurrent() on null

I get error when try a migration on Laravel 5.3 (on 5.2 work this code)

local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function useCurrent() on null in /home/vagrant/setdart/database/migrations/2016_07_02_081018_create_migration_corrections_table.php:26

On code

$table->timestamps('created_at')->useCurrent();

Also try

$table->timestamps('created_at')->nullable(true)->useCurrent();

It's a bug? A mistake?

0 likes
4 replies
o_voloshin's avatar

Well, that's quite late to answer, I believe. Anyways, just in case anyone gets this error, you have to write timestamp instead of timestamps.

11 likes
ankitparmar372's avatar

Hello abkrim

Use this :

$table->timestamps();

this create two fields creared_at and updated_at and its add time automatically while create or update you dont need to give it manually. Thanks.

Please or to participate in this conversation.