-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRokkaLaravelServiceProvider.php
51 lines (44 loc) · 1.14 KB
/
RokkaLaravelServiceProvider.php
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
<?php
namespace Rokka\RokkaLaravel;
use Illuminate\Support\ServiceProvider;
class RokkaLaravelServiceProvider extends ServiceProvider
{
public const ALIAS = 'rokka';
/**
* Perform post-registration booting of services.
*
* @return void
*/
public function boot(): void
{
// Publishing is only necessary when using the CLI.
if ($this->app->runningInConsole()) {
// Publishing the configuration file.
$this->publishes([
__DIR__ . '/../config/rokka.php' => config_path('rokka.php'),
], 'config');
}
}
/**
* Register any package services.
*
* @return void
*/
public function register(): void
{
$this->mergeConfigFrom(__DIR__ . '/../config/rokka.php', 'rokka');
// Register the service the package provides.
$this->app->singleton(self::ALIAS, function ($app) {
return new RokkaLaravel;
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides(): array
{
return [self::ALIAS];
}
}