Answers for "run migration command in laravel"

PHP
5

migration rollback

php artisan migrate:rollback
Posted by: Guest on May-04-2020
2

create new migration with terminal in laravel

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
1

create migration command in laravel

php artisan make:model Employee -m
Posted by: Guest on June-21-2021
0

laravel migration constrained

Schema::table('posts', function (Blueprint $table) {
    $table->foreignId('user_id')->constrained();
});

/* The foreignId method is an alias for unsignedBigInteger while the
 * constrained method will use conventions to determine the table and
 * column name being referenced. If your table name does not match
 * Laravel's conventions, you may specify the table name by passing it
 * as an argument to the constrained method:
*/

Schema::table('posts', function (Blueprint $table) {
    $table->foreignId('user_id')->constrained('users');
});
Posted by: Guest on December-29-2020

Code answers related to "run migration command in laravel"

Browse Popular Code Answers by Language