-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathServiceProvider.php
More file actions
70 lines (58 loc) · 1.75 KB
/
ServiceProvider.php
File metadata and controls
70 lines (58 loc) · 1.75 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
<?php
declare(strict_types=1);
namespace DragonCode\LaravelDeployOperations;
use DragonCode\LaravelDeployOperations\Concerns\About;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
class ServiceProvider extends BaseServiceProvider
{
use About;
public function boot(): void
{
if ($this->app->runningInConsole()) {
$this->publishConfig();
$this->publishStub();
$this->registerAbout();
$this->registerCommands();
$this->registerMigrations();
}
}
public function register(): void
{
$this->registerConfig();
}
protected function registerCommands(): void
{
$this->commands([
Console\Operations::class,
Console\Fresh::class,
Console\Install::class,
Console\Make::class,
Console\Refresh::class,
Console\Reset::class,
Console\Rollback::class,
Console\Status::class,
]);
}
protected function registerMigrations(): void
{
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
}
protected function publishConfig(): void
{
$this->publishes([
__DIR__ . '/../config/deploy-operations.php' => $this->app->configPath('deploy-operations.php'),
], 'config');
}
protected function publishStub(): void
{
$this->publishes([
__DIR__ . '/../resources/stubs/deploy-operation.stub' => $this->app->basePath(
'stubs/deploy-operation.stub'
),
], 'stubs');
}
protected function registerConfig(): void
{
$this->mergeConfigFrom(__DIR__ . '/../config/deploy-operations.php', 'deploy-operations');
}
}