|
6 | 6 | use Lauthz\Models\Rule;
|
7 | 7 | use Lauthz\Observers\RuleObserver;
|
8 | 8 |
|
9 |
| -class LauthzServiceProvider extends ServiceProvider { |
10 |
| - /** |
11 |
| - * Perform post-registration booting of services. |
12 |
| - */ |
13 |
| - public function boot() { |
14 |
| - if ($this->app->runningInConsole()) { |
15 |
| - $this->publishes([__DIR__ . '/../database/migrations' => database_path('migrations')], 'laravel-lauthz-migrations'); |
16 |
| - $this->publishes([__DIR__ . '/../config/lauthz-rbac-model.conf' => config_path('lauthz-rbac-model.conf')], 'laravel-lauthz-config'); |
17 |
| - $this->publishes([__DIR__ . '/../config/lauthz.php' => config_path('lauthz.php')], 'laravel-lauthz-config'); |
18 |
| - |
19 |
| - $this->commands([ |
20 |
| - Commands\GroupAdd::class, |
21 |
| - Commands\PolicyAdd::class, |
22 |
| - Commands\RoleAssign::class, |
23 |
| - ]); |
24 |
| - } |
25 |
| - |
26 |
| - $this->mergeConfigFrom(__DIR__ . '/../config/lauthz.php', 'lauthz'); |
27 |
| - |
28 |
| - $this->bootObserver(); |
29 |
| - } |
30 |
| - |
31 |
| - /** |
32 |
| - * Boot Observer. |
33 |
| - * |
34 |
| - * @return void |
35 |
| - */ |
36 |
| - protected function bootObserver() { |
37 |
| - Rule::observe(new RuleObserver()); |
38 |
| - } |
39 |
| - |
40 |
| - /** |
41 |
| - * Register bindings in the container. |
42 |
| - */ |
43 |
| - public function register() { |
44 |
| - $this->app->singleton('enforcer', function ($app) { |
45 |
| - return new EnforcerManager($app); |
46 |
| - }); |
47 |
| - } |
| 9 | +class LauthzServiceProvider extends ServiceProvider |
| 10 | +{ |
| 11 | + /** |
| 12 | + * Perform post-registration booting of services. |
| 13 | + */ |
| 14 | + public function boot() |
| 15 | + { |
| 16 | + if ($this->app->runningInConsole()) { |
| 17 | + $this->publishes([__DIR__ . '/../database/migrations' => database_path('migrations')], 'laravel-lauthz-migrations'); |
| 18 | + $this->publishes([__DIR__ . '/../config/lauthz-rbac-model.conf' => config_path('lauthz-rbac-model.conf')], 'laravel-lauthz-config'); |
| 19 | + $this->publishes([__DIR__ . '/../config/lauthz.php' => config_path('lauthz.php')], 'laravel-lauthz-config'); |
| 20 | + |
| 21 | + $this->commands([ |
| 22 | + Commands\GroupAdd::class, |
| 23 | + Commands\PolicyAdd::class, |
| 24 | + Commands\RoleAssign::class, |
| 25 | + ]); |
| 26 | + } |
| 27 | + |
| 28 | + $this->mergeConfigFrom(__DIR__ . '/../config/lauthz.php', 'lauthz'); |
| 29 | + |
| 30 | + $this->bootObserver(); |
| 31 | + } |
| 32 | + |
| 33 | + /** |
| 34 | + * Boot Observer. |
| 35 | + * |
| 36 | + * @return void |
| 37 | + */ |
| 38 | + protected function bootObserver() |
| 39 | + { |
| 40 | + Rule::observe(new RuleObserver()); |
| 41 | + } |
| 42 | + |
| 43 | + /** |
| 44 | + * Register bindings in the container. |
| 45 | + */ |
| 46 | + public function register() |
| 47 | + { |
| 48 | + $this->app->singleton('enforcer', function ($app) { |
| 49 | + return new EnforcerManager($app); |
| 50 | + }); |
| 51 | + } |
48 | 52 | }
|
0 commit comments