Question : set default value for column in laravel model
Answered by : fahim-foysal-rabby
protected $attributes = [ 'your_field_name' => 'default value'
];
Source : | Last Update : Fri, 30 Jul 21
Question : how assign default value to laravel migration column
Answered by : shafeeque-ahmad
You can use change() method:
Schema::table('users', function ($table) { $table->integer('active')->default(0)->change();
});
Source : https://stackoverflow.com/questions/37003469/laravel-migrations-change-default-value-of-column | Last Update : Thu, 10 Feb 22