Bristol SU Support Package
SupportServiceProvider.php
Go to the documentation of this file.
1 <?php
2 
3 namespace BristolSU\Support;
4 
23 
28 class SupportServiceProvider extends ServiceProvider
29 {
30 
34  protected $providers = [
35  ActionServiceProvider::class,
36  ActivityServiceProvider::class,
37  EventsServiceProvider::class,
38  ActivityInstanceServiceProvider::class,
39  AuthorizationServiceProvider::class,
40  CompletionConditionServiceProvider::class,
41  ConnectionServiceProvider::class,
42  FilterServiceProvider::class,
43  LogicServiceProvider::class,
44  PermissionServiceProvider::class,
45  AuthenticationServiceProvider::class,
46  ModuleFrameworkServiceProvider::class,
47  ModuleInstanceServiceProvider::class,
48  UserServiceProvider::class,
49  HttpServiceProvider::class,
50  RevisionServiceProvider::class
51  ];
52 
53  public function register()
54  {
55  $this->registerProviders();
56  $this->registerConfig();
57  $this->registerMigrations();
58  $this->registerViews();
59  $this->registerRoutes();
60  }
61 
62  public function registerProviders()
63  {
64  foreach ($this->providers as $provider) {
65  $this->app->register($provider);
66  }
67  }
68 
69  public function registerConfig()
70  {
71  $this->publishes([__DIR__.'/../config/config.php' => config_path('support.php')], 'config');
72  $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'support');
73  }
74 
75  public function registerMigrations()
76  {
77  $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
78  }
79 
80  public function registerViews()
81  {
82  $this->publishes([
83  __DIR__.'/../resources/views' => resource_path('views/vendor/bristolsu'),
84  ], 'views');
85 
86  $this->loadViewsFrom(__DIR__.'/../resources/views', 'bristolsu');
87  }
88 
89  public function registerRoutes()
90  {
91  Route::middleware(['web', 'module', 'activity'])
92  ->namespace('\BristolSU\Support\Http\Controllers')
93  ->group(__DIR__.'/../routes/web.php');
94  }
95 
96 }