From 20ba925acd021e3cd75ee499bc133bb9b76b09d2 Mon Sep 17 00:00:00 2001 From: Andrey Karaulschikov Date: Mon, 21 Sep 2020 12:00:29 +0300 Subject: [PATCH] PublishMigrations --- README.md | 2 +- src/Kodeine/Acl/AclServiceProvider.php | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 490af09..3ccd24e 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ composer require kodeine/laravel-acl "^1.0" ], ``` -3. Publish the package configuartion files and add your own models to the list of ACL models" +3. Publish the package configuartion files, migrations and add your own models to the list of ACL models" ``` $ php artisan vendor:publish --provider="Kodeine\Acl\AclServiceProvider" diff --git a/src/Kodeine/Acl/AclServiceProvider.php b/src/Kodeine/Acl/AclServiceProvider.php index d64f7d7..6ee1c59 100644 --- a/src/Kodeine/Acl/AclServiceProvider.php +++ b/src/Kodeine/Acl/AclServiceProvider.php @@ -21,8 +21,20 @@ class AclServiceProvider extends ServiceProvider */ public function boot() { - $this->publishConfig(); - $this->loadMigrationsFrom(__DIR__ . '/../../migrations'); + $this->publishes( + [ + __DIR__ . '/../../config/acl.php' => config_path('acl.php') + ], + 'config' + ); + + $this->publishes( + [ + __DIR__ . '/../../migrations/' => base_path('/database/migrations') + ], + 'migrations' + ); + $this->registerBladeDirectives(); } @@ -38,16 +50,6 @@ public function register() ); } - /** - * Publish the config file to the application config directory - */ - public function publishConfig() - { - $this->publishes([ - __DIR__ . '/../../config/acl.php' => config_path('acl.php'), - ], 'config'); - } - public function registerBladeDirectives() { // role