Question : Laravel: Set timestamp column to current timestamp
Answered by : modern-mouse-zderuoz9yx4z
<?php
/* For Create */
$table->timestamp('created_at')->useCurrent();
/* For Update */
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
Source : https://postsrc.com/code-snippets/how-to-set-timestamp-columns-to-the-current-timestamp-in-laravel-8-migrations | Last Update : Fri, 08 Jul 22
Question : custom timestamp column laravel
Answered by : concerned-caribou-31hmbpxn1dgg
class BaseModel extends Eloquent { const CREATED_AT = 'date_created'; const UPDATED_AT = 'date_modified';
}
Source : https://stackoverflow.com/questions/25010435/laravel-custom-timestamp-column-names | Last Update : Tue, 02 Nov 21