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

lsblsb's avatar

Laravel 5.5: Migrations : Schema Creation : useCurrent() not working on date column?

Although my mysql database version is capable of setting CURRENT_TIMESTAMP as a default value for a date column (also tested it manually), Laravels useCurrent() method does not lead to a date column with a CURRENT_TIMESTAMP as default.

Is this a bug, or am I doing something wrong?

My Code:

Schema::create('myTable', function (Blueprint $table) {
        $table->increments('ID')->comment('The autoincrement primary key.');
        //...
        $table->date('from')->useCurrent()->comment('The date the voucher is valid from.');
        //...
    });
0 likes
2 replies

Please or to participate in this conversation.