laravel create migration from model code example

Example 1: laravel make model and migration

php artisan make:model Settings -m

Example 2: laravel create model and migration

# 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

Example 3: artisan refresh

Try this command it works for me

php artisan migrate:fresh
However, be careful! This command will drop all data from your DB:

Example 4: laravel create migration

php artisan make:migration add_votes_to_users_table --table=users

php artisan make:migration create_users_table --create=users

Example 5: laravel create db table

php artisan make:migration create_users_table

Example 6: laravel drop table migration

Schema::drop('users');

Schema::dropIfExists('users');

Tags:

Sql Example