Use –create option when create migration

To create migration, we can use this artisan command.

Laravel will create a new migration file in database/migrations directory.

Generated file is like this:

up() method is used to create a new tables or add new columns to table.
down() method is used to rollback.

We can use --create option when create migration to automatically generate base code.

Generated file is like this:



You may also like...

Leave a Reply