Answers for "laravel migration after column"

PHP
3

laravel migration add column after

Schema::table('users', function ($table) {
    $table->string('email')->after('id')->nullable();
});
Posted by: Guest on December-11-2020
1

how set field after another field in migration in laravel

Schema::table('users', function($table)
{
    $table->string('phone_nr')->after('id');
});
Posted by: Guest on August-04-2021
2

laravel create migration

php artisan make:migration add_votes_to_users_table --table=users

php artisan make:migration create_users_table --create=users
Posted by: Guest on June-27-2020
0

laravel add column to table

// The table method on the Schema facade MAY BE USED TO UPDATE EXISTING TABLES.
// The table method accepts two arguments: the name of the table and a Closure
// that receives a Blueprint instance you may use to add columns to the table:
Schema::table('users', function (Blueprint $table) {
    $table->string('email');
});
Posted by: Guest on January-18-2021

Code answers related to "laravel migration after column"

Browse Popular Code Answers by Language