1
|
|
|
<?php namespace Arcanesoft\Blog\Providers; |
2
|
|
|
|
3
|
|
|
use Arcanedev\Support\Providers\CommandServiceProvider as ServiceProvider; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class CommandServiceProvider |
7
|
|
|
* |
8
|
|
|
* @package Arcanesoft\Blog\Providers |
9
|
|
|
* @author ARCANEDEV <[email protected]> |
10
|
|
|
*/ |
11
|
|
|
class CommandServiceProvider extends ServiceProvider |
12
|
|
|
{ |
13
|
|
|
/* ------------------------------------------------------------------------------------------------ |
14
|
|
|
| Main Functions |
15
|
|
|
| ------------------------------------------------------------------------------------------------ |
16
|
|
|
*/ |
17
|
|
|
/** |
18
|
|
|
* Register the service provider. |
19
|
|
|
*/ |
20
|
|
|
public function register() |
21
|
|
|
{ |
22
|
|
|
$this->registerPublishCommand(); |
23
|
|
|
$this->registerSetupCommand(); |
24
|
|
|
|
25
|
|
|
$this->commands($this->commands); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Get the provided commands. |
30
|
|
|
* |
31
|
|
|
* @return array |
32
|
|
|
*/ |
33
|
|
|
public function provides() |
34
|
|
|
{ |
35
|
|
|
return [ |
36
|
|
|
'arcanesoft.blog.commands.publish', |
37
|
|
|
'arcanesoft.blog.commands.setup', |
38
|
|
|
]; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/* ------------------------------------------------------------------------------------------------ |
42
|
|
|
| Command Functions |
43
|
|
|
| ------------------------------------------------------------------------------------------------ |
44
|
|
|
*/ |
45
|
|
|
/** |
46
|
|
|
* Register the publish command. |
47
|
|
|
*/ |
48
|
|
|
private function registerPublishCommand() |
49
|
|
|
{ |
50
|
|
|
$this->app->singleton( |
51
|
|
|
'arcanesoft.blog.commands.publish', |
52
|
|
|
\Arcanesoft\Blog\Console\PublishCommand::class |
53
|
|
|
); |
54
|
|
|
|
55
|
|
|
$this->commands[] = \Arcanesoft\Blog\Console\PublishCommand::class; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Register the setup command. |
60
|
|
|
*/ |
61
|
|
|
private function registerSetupCommand() |
62
|
|
|
{ |
63
|
|
|
$this->app->singleton( |
64
|
|
|
'arcanesoft.blog.commands.setup', |
65
|
|
|
\Arcanesoft\Blog\Console\SetupCommand::class |
66
|
|
|
); |
67
|
|
|
|
68
|
|
|
$this->commands[] = \Arcanesoft\Blog\Console\SetupCommand::class; |
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
|