laravel migration file datetime code example
Example 1: laravel before migration
Schema::table('users', function ($table) {
$table->string('email')->after('id')->nullable();
});
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');
}