Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how add field to table by another migration in laravel

php artisan make:migration add_store_id_to_users_table --table=users
Comment

how set field after another field in migration in laravel

Schema::table('users', function($table)
{
    $table->string('phone_nr')->after('id');
});
Comment

Add fields to a table with a migration - Laravel

php artisan make:migration add_company_id_to_users_table

//in up() method
Schema::table('users', function (Blueprint $table) {
  $table->unsignedBigInteger('company_id');
});

//in down() method
Schema::table('users', function (Blueprint $table) {
  $table->dropColumn('company_id');
});
Comment

PREVIOUS NEXT
Code Example
Php :: count with left join in laravel 
Php :: php foreach 
Php :: install soap in php linux 
Php :: How to create a controller in laravel 
Php :: random array php 
Php :: if object or array in php 
Php :: mysqli loop 
Php :: PHP Simple HTML DOM 
Php :: laravel blade form old value 
Php :: laravel form in 24 hours format 
Php :: redirect back with input laravel in request 
Php :: php failed to open stream: Permission denied iis 
Php :: php install dependency 
Php :: symfony server start port 
Php :: laravel old value or default 
Php :: blade condition if else laravel 
Php :: wordpress custom post type disable add new 
Php :: self submit form php 
Php :: php json request get value of an array element 
Php :: PHP substr_count — Count the number of substring occurrences 
Php :: print array items in php 
Php :: how to add an custom error to validater error in laravel 
Php :: how to display image in wordpress 
Php :: LARAVEL CREAT NEW TEST 
Php :: how validate the becrypt password in laravel 
Php :: php days in month 
Php :: json to array php 
Php :: ubuntu laravel storage permission 
Php :: laravel map array 
Php :: php check if folder exists 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =