timestamp in laravel migration code example
Example 1: mysql timestamp in laravel migration
$table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
Example 2: datetime-local laravel migration data type
public function getDateStartAttribute($value)
{
return Carbon::parse($value)->format('Y-m-d\TH:i');
}
public function getDateEndAttribute($value)
{
return Carbon::parse($value)->format('Y-m-d\TH:i');
}