phplaravellaravel-migrations

How to specify folder for laravel migrations?


I am trying to put laravel database migrations in sub folders, but not sure how to do this.


Solution

  • When creating new migrations and executing your migrations, you can pass in a path parameter through the command line interface to specify the directory it will use to create and run the migrations respectively.

    php artisan make:migration create_users_table --path=/path/to/your/migration/directory
    
    php artisan migrate --path=/path/to/your/migration/directory