Set The Default Value Of A Timestamp Column To The

[Solved] Set The Default Value Of A Timestamp Column To The | Php - Code Explorer | yomemimo.com
Question : Set the Default Value of a Timestamp Column to the Current Timestamp with Laravel Migrations

Answered by : clever-corncrake-tm5rnsrlus5r

$table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));

Source : https://stackoverflow.com/questions/18067614/how-can-i-set-the-default-value-of-a-timestamp-column-to-the-current-timestamp-w | Last Update : Tue, 11 Aug 20

Answers related to set the default value of a timestamp column to the current timestamp with laravel migrations

Code Explorer Popular Question For Php