Schema::table('posts', function (Blueprint $table) { $table->unsignedInteger('user_id'); $table->foreign('user_id')->references('id')->on('users'); });
php artisan make:Model Status -m
Try this command it works for me php artisan migrate:fresh However, be careful! This command will drop all data from your DB:
php artisan migrate
php artisan make:migration add_votes_to_users_table --table=users php artisan make:migration create_users_table --create=users
php artisan migrate:refresh php artisan migrate:refresh --seed
# If you would like to generate a database migration when you # generate the model, you may use the --migration or -m option: php artisan make:model Flight --migration php artisan make:model Flight -m
php artisan make:migration create_users_table
php artisan make:model Model_Name -m