-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathServiceProvider.php
43 lines (37 loc) · 1.09 KB
/
ServiceProvider.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
<?php
namespace Wovosoft\Crud;
use Wovosoft\Crud\Commands\CrudCommand;
use Wovosoft\Crud\Commands\MakeController;
use Wovosoft\Crud\Commands\MakeModel;
use Wovosoft\Crud\Commands\PackageNew;
use Wovosoft\Crud\Commands\PackageRemove;
use Wovosoft\Crud\Commands\RemoveController;
use Wovosoft\Crud\Commands\RemoveModel;
class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
const CONFIG_PATH = __DIR__ . '/../config/wovosoft-crud.php';
public function boot()
{
$this->publishes([
self::CONFIG_PATH => config_path('wovosoft-crud.php'),
], 'config');
if ($this->app->runningInConsole()) {
$this->commands([
PackageNew::class,
PackageRemove::class,
MakeModel::class,
RemoveModel::class,
MakeController::class,
RemoveController::class,
CrudCommand::class
]);
}
}
public function register()
{
$this->mergeConfigFrom(
self::CONFIG_PATH,
'wovosoft-crud'
);
}
}