diff --git a/config/shinobi.php b/config/shinobi.php new file mode 100644 index 0000000..859fd0d --- /dev/null +++ b/config/shinobi.php @@ -0,0 +1,5 @@ + true, +]; diff --git a/src/ShinobiServiceProvider.php b/src/ShinobiServiceProvider.php index 77fc779..a55a199 100644 --- a/src/ShinobiServiceProvider.php +++ b/src/ShinobiServiceProvider.php @@ -22,12 +22,18 @@ class ShinobiServiceProvider extends ServiceProvider */ public function boot() { + $this->publishes([ + __DIR__.'/../config/shinobi.php' => config_path('shinobi.php'), + ]); + if (version_compare(Application::VERSION, '5.3.0', '<')) { $this->publishes([ - __DIR__.'/../migrations' => $this->app->databasePath().'/migrations', + __DIR__ . '/../migrations' => $this->app->databasePath() . '/migrations', ], 'migrations'); } else { - $this->loadMigrationsFrom(__DIR__.'/../migrations'); + if (config('shinobi.run-migrations', true)) { + $this->loadMigrationsFrom(__DIR__ . '/../migrations'); + } } $this->registerBladeDirectives(); @@ -40,6 +46,10 @@ public function boot() */ public function register() { + $this->mergeConfigFrom( + __DIR__.'/../config/shinobi.php', 'shinobi' + ); + $this->app->singleton('shinobi', function ($app) { $auth = $app->make('Illuminate\Contracts\Auth\Guard');