This repository was archived by the owner on Nov 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathServiceProvider.php
More file actions
107 lines (97 loc) · 2.32 KB
/
ServiceProvider.php
File metadata and controls
107 lines (97 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
namespace Slides\Saml2;
/**
* Class ServiceProvider
*
* @package Slides\Saml2
*/
class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->bootMiddleware();
$this->bootRoutes();
$this->bootPublishes();
$this->bootCommands();
$this->loadMigrations();
}
/**
* Bootstrap the routes.
*
* @return void
*/
protected function bootRoutes()
{
if($this->app['config']['saml2.useRoutes'] == true) {
include __DIR__ . '/Http/routes.php';
}
}
/**
* Bootstrap the publishable files.
*
* @return void
*/
protected function bootPublishes()
{
$source = __DIR__ . '/../config/saml2.php';
$this->publishes([$source => config_path('saml2.php')]);
$this->mergeConfigFrom($source, 'saml2');
}
/**
* Bootstrap the console commands.
*
* @return void
*/
protected function bootCommands()
{
$this->commands([
\Slides\Saml2\Commands\CreateCertificate::class,
\Slides\Saml2\Commands\CreateTenant::class,
\Slides\Saml2\Commands\UpdateTenant::class,
\Slides\Saml2\Commands\DeleteTenant::class,
\Slides\Saml2\Commands\RestoreTenant::class,
\Slides\Saml2\Commands\ListTenants::class,
\Slides\Saml2\Commands\TenantCredentials::class
]);
}
/**
* Bootstrap the console commands.
*
* @return void
*/
protected function bootMiddleware()
{
$this->app['router']->aliasMiddleware('saml2.resolveTenant', \Slides\Saml2\Http\Middleware\ResolveTenant::class);
}
/**
* Load the package migrations.
*
* @return void
*/
protected function loadMigrations()
{
if (config('saml2.load_migrations', true)) {
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
}