diff --git a/readme.md b/readme.md index ea461f0..cc4e5fe 100644 --- a/readme.md +++ b/readme.md @@ -65,7 +65,7 @@ Add the package to your application service providers in `config/app.php` file. Publish the package config file and migrations to your application. Run these commands inside your terminal. - php artisan vendor:publish --provider="HttpOz\Roles\RolesServiceProvider" --tag=config + php artisan vendor:publish --provider="HttpOz\Roles\RolesServiceProvider" And also run migrations. @@ -272,4 +272,4 @@ For more information, please have a look at [HasRole](https://github.com/httpoz/ ## License -This package is free software distributed under the terms of the MIT license. \ No newline at end of file +This package is free software distributed under the terms of the MIT license. diff --git a/src/HttpOz/Roles/RolesServiceProvider.php b/src/HttpOz/Roles/RolesServiceProvider.php index a7a5675..ff5e2c0 100644 --- a/src/HttpOz/Roles/RolesServiceProvider.php +++ b/src/HttpOz/Roles/RolesServiceProvider.php @@ -19,8 +19,14 @@ public function boot() $this->publishes([ __DIR__ . '/../../config/roles.php' => config_path('roles.php') ], 'config'); - - $this->loadMigrationsFrom(__DIR__ . '/../../migrations/'); + + $stub = __DIR__ . '/../../migrations/'; + $target = database_path('migrations').'/'; + + $this->publishes([ + $stub.'create_roles_table.php' => $target.date('Y_m_d_His', time()).'_create_roles_table.php', + $stub.'create_role_user_table.php' => $target.date('Y_m_d_His', time()+1).'_create_role_user_table.php' + ], 'migrations'); $this->registerBladeExtensions(); } @@ -54,4 +60,4 @@ public function registerBladeExtensions() return ""; }); } -} \ No newline at end of file +} diff --git a/src/migrations/2016_09_02_082701_create_role_user_table.php b/src/migrations/create_role_user_table.php similarity index 100% rename from src/migrations/2016_09_02_082701_create_role_user_table.php rename to src/migrations/create_role_user_table.php diff --git a/src/migrations/2016_09_02_082356_create_roles_table.php b/src/migrations/create_roles_table.php similarity index 100% rename from src/migrations/2016_09_02_082356_create_roles_table.php rename to src/migrations/create_roles_table.php