Search
 
SCRIPT & CODE EXAMPLE
 

PHP

set default value for column in laravel model

protected $attributes = [ 
	'your_field_name' => 'default value' 
]; 
Comment

how assign default value to laravel migration column

You can use change() method:

Schema::table('users', function ($table) {
    $table->integer('active')->default(0)->change();
});
Comment

PREVIOUS NEXT
Code Example
Php :: how to redirect to another page from laravel blade 
Php :: best pagination in laravel api with eloquent 
Php :: How do I make a redirect in PHP? 
Php :: laravel check if request wantsjson 
Php :: laravel order by relationship 
Php :: append to collection laravel 
Php :: carbon parse timestamp 
Php :: foreach total sum 
Php :: how to find this day is holiday in php day 
Php :: php shutdown function 
Php :: php artisan storage link cpanel 
Php :: Target class [Controller] does not exist. 
Php :: php header pdf 
Php :: laravel vue build production 
Php :: validation not exists with this id laravel 
Php :: add pagination to wordpress 
Php :: convert multi-dimensional array into a single array in laravel 
Php :: pass javascriot value from one page to another 
Php :: laravel eloquent to array key value 
Php :: yum install php-mysql 
Php :: wordpress add to cart redirect php 
Php :: php 7 strict mode 
Php :: yyyymmdd to yyyy-mm-dd php 
Php :: Class "AppHttpControllersAdminAuth" not found 
Php :: php json request get value of an array element 
Php :: sendinblue send mail 
Php :: laravel make view 
Php :: php send telegram message to user 
Php :: display custom post type 
Php :: wordpress custom post type add post_tag 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =