|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Yajra\DataTables; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\Support\ServiceProvider; |
|
6
|
|
|
use Maatwebsite\Excel\ExcelServiceProvider; |
|
7
|
|
|
use Yajra\DataTables\Generators\DataTablesHtmlCommand; |
|
8
|
|
|
use Yajra\DataTables\Generators\DataTablesMakeCommand; |
|
9
|
|
|
use Yajra\DataTables\Generators\DataTablesScopeCommand; |
|
10
|
|
|
|
|
11
|
|
|
class ButtonsServiceProvider extends ServiceProvider |
|
12
|
|
|
{ |
|
13
|
|
|
/** |
|
14
|
|
|
* Bootstrap the application events. |
|
15
|
|
|
* |
|
16
|
|
|
* @return void |
|
17
|
|
|
*/ |
|
18
|
|
|
public function boot() |
|
19
|
|
|
{ |
|
20
|
|
|
$this->loadViewsFrom(__DIR__ . '/resources/views', 'datatables'); |
|
21
|
|
|
|
|
22
|
|
|
$this->publishAssets(); |
|
23
|
|
|
|
|
24
|
|
|
$this->registerCommands(); |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* Publish datatables assets. |
|
29
|
|
|
*/ |
|
30
|
|
|
protected function publishAssets() |
|
31
|
|
|
{ |
|
32
|
|
|
$this->publishes([ |
|
33
|
|
|
__DIR__ . '/config/config.php' => config_path('datatables-buttons.php'), |
|
34
|
|
|
], 'datatables-buttons'); |
|
35
|
|
|
|
|
36
|
|
|
$this->publishes([ |
|
37
|
|
|
__DIR__ . '/resources/assets/buttons.server-side.js' => public_path('vendor/datatables/buttons.server-side.js'), |
|
38
|
|
|
], 'datatables-buttons'); |
|
39
|
|
|
|
|
40
|
|
|
$this->publishes([ |
|
41
|
|
|
__DIR__ . '/resources/views' => base_path('/resources/views/vendor/datatables'), |
|
42
|
|
|
], 'datatables-buttons'); |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* Register datatables commands. |
|
47
|
|
|
*/ |
|
48
|
|
|
protected function registerCommands() |
|
49
|
|
|
{ |
|
50
|
|
|
$this->commands(DataTablesMakeCommand::class); |
|
51
|
|
|
$this->commands(DataTablesScopeCommand::class); |
|
52
|
|
|
$this->commands(DataTablesHtmlCommand::class); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* Register the service provider. |
|
57
|
|
|
* |
|
58
|
|
|
* @return void |
|
59
|
|
|
*/ |
|
60
|
|
|
public function register() |
|
61
|
|
|
{ |
|
62
|
|
|
$this->mergeConfigFrom(__DIR__ . '/config/config.php', 'datatables-buttons'); |
|
63
|
|
|
|
|
64
|
|
|
$this->app->register(HtmlServiceProvider::class); |
|
65
|
|
|
$this->app->register(ExcelServiceProvider::class); |
|
66
|
|
|
} |
|
67
|
|
|
} |
|
68
|
|
|
|