1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Microboard\Providers; |
4
|
|
|
|
5
|
|
|
use Illuminate\Support\ServiceProvider; |
6
|
|
|
use Microboard\Commands\InstallCommand; |
7
|
|
|
use Microboard\Commands\ResourceCommand; |
8
|
|
|
use Microboard\Commands\ResourceController; |
9
|
|
|
use Microboard\Commands\ResourceDataTables; |
10
|
|
|
use Microboard\Commands\ResourceRequest; |
11
|
|
|
use Microboard\Commands\ResourcePolicy; |
12
|
|
|
use Microboard\Commands\WidgetMakeCommand; |
13
|
|
|
use Microboard\Factory; |
14
|
|
|
|
15
|
|
|
class MicroboardServiceProvider extends ServiceProvider |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* Bootstrap the package services. |
19
|
|
|
*/ |
20
|
|
|
public function boot() |
21
|
|
|
{ |
22
|
|
|
$this->loadMigrationsFrom(__DIR__ . '/../../database'); |
23
|
|
|
|
24
|
|
|
if ($this->app->runningInConsole()) { |
25
|
|
|
$this->publishes([ |
26
|
|
|
__DIR__ . '/../../config/config.php' => config_path('microboard.php'), |
27
|
|
|
__DIR__ . '/../../stubs/web.stub' => base_path('routes/microboard.php'), |
28
|
|
|
__DIR__ . '/../../stubs/service.stub' => app_path('Providers/MicroboardServiceProvider.php'), |
29
|
|
|
__DIR__ . '/../../stubs/datatable-script.stub' => resource_path('views/vendor/datatables/script.blade.php'), |
30
|
|
|
__DIR__ . '/../../stubs/user-placeholder.png' => public_path('storage/user-placeholder.png'), |
31
|
|
|
], 'microboard'); |
32
|
|
|
|
33
|
|
|
$this->commands([ |
34
|
|
|
InstallCommand::class, |
35
|
|
|
WidgetMakeCommand::class, |
36
|
|
|
ResourceDataTables::class, |
37
|
|
|
ResourceController::class, |
38
|
|
|
ResourcePolicy::class, |
39
|
|
|
ResourceRequest::class, |
40
|
|
|
ResourceCommand::class |
41
|
|
|
]); |
42
|
|
|
} |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Register the package services. |
47
|
|
|
*/ |
48
|
|
|
public function register() |
49
|
|
|
{ |
50
|
|
|
$this->mergeConfigFrom(__DIR__ . '/../../config/config.php', 'microboard'); |
51
|
|
|
$this->app->singleton(Factory::class); |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
|