Answers for "add default column in larAVEL for all new table"

PHP
0

laravel migration change column default

Schema::table('users', function ($table) {
    $table->integer('active')->default(0)->change();
});
Posted by: Guest on June-03-2021
0

set default value for column in laravel model

protected $attributes = [ 
	'your_field_name' => 'default value' 
];
Posted by: Guest on July-23-2021

Code answers related to "add default column in larAVEL for all new table"

Browse Popular Code Answers by Language