Laravel create migration file in specific folder

后端 未结 3 1658
鱼传尺愫
鱼传尺愫 2021-01-04 01:18

I\'ve created Payment package for my laravel project

I want to make migration files inside migrations folder of my package. How can create it using artisan command?

3条回答
  •  离开以前
    2021-01-04 01:39

    you need to publish them from your package to your migrations folder like this in your package service provider boot method:

      $this->publishes([
            __DIR__.'/Database/migrations/' => database_path('migrations'),
        ], 'migrations');
    

    run this command php artisan vendor:publish --tag=migrations

    and after that you can run php artisan migrate

提交回复
热议问题