diff --git a/README.md b/README.md index 805331a..9d82e1e 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,11 @@ php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvid // then, add the Spatie\Permission\Traits\HasRoles trait to your User model(s) ``` -3) Publish `backpack\permissionmanager` config file: +3) Publish `backpack\permissionmanager` config file & the migrations: ```bash -php artisan vendor:publish --provider="Backpack\PermissionManager\PermissionManagerServiceProvider" --tag="config" +php artisan vendor:publish --provider="Backpack\PermissionManager\PermissionManagerServiceProvider" --tag="config" --tag="migrations" ``` -> Note: _We recommend you to publish only the config file, but you may also publish lang and routes._ +> Note: _We recommend you to publish only the config file and migrations, but you may also publish lang and routes._ 4) Run the migrations: ```bash diff --git a/src/PermissionManagerServiceProvider.php b/src/PermissionManagerServiceProvider.php index 1b08151..db5d9f0 100644 --- a/src/PermissionManagerServiceProvider.php +++ b/src/PermissionManagerServiceProvider.php @@ -47,8 +47,8 @@ public function boot() // publish route file $this->publishes([__DIR__.$this->routeFilePath => base_path($this->routeFilePath)], 'routes'); - // load migration from Backpack 4.0 to Backpack 4.1 - $this->loadMigrationsFrom(__DIR__.'/database/migrations'); + // publish migration from Backpack 4.0 to Backpack 4.1 + $this->publishes([__DIR__.'/database/migrations' => database_path('migrations')], 'migrations'); } /**