Answers for "how to create migration with model in laravel"

PHP
11

laravel make model with migration and controller

php artisan make:model Todo -mcr
Posted by: Guest on September-27-2020
21

laravel foreign key

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

    $table->foreign('user_id')->references('id')->on('users');
});
OR
Schema::table('posts', function (Blueprint $table) {
    $table->foreignId('user_id')->constrained();
});
Posted by: Guest on December-09-2020
5

migration rollback

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

artisan make model with migration

php artisan make:model Model_Name -m
Posted by: Guest on May-14-2020
3

laravel make model and migration

php artisan make:model Settings -m
Posted by: Guest on February-28-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

Code answers related to "how to create migration with model in laravel"

Browse Popular Code Answers by Language