-
Notifications
You must be signed in to change notification settings - Fork 1
/
ReportsServiceProvider.php
70 lines (64 loc) · 2.23 KB
/
ReportsServiceProvider.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
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 agoalofalife\Reports;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
class ReportsServiceProvider extends ServiceProvider
{
public function boot()
{
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'reports');
$this->registerRoutes();
$this->commands([
Console\InstallCommand::class,
Console\AssetsConsole::class,
Console\SeederCommand::class,
Console\ReportMakeCommand::class,
]);
$this->loadViews();
$this->mergeConfigFrom(__DIR__.'/../config/reports.php', 'reports');
$this->toPublish();
}
public function register()
{
if (! defined('REPORTS_PATH')) {
define('POSTMAN_PATH', realpath(__DIR__.'/../'));
}
}
protected function toPublish()
{
// $this->publishes([
// __DIR__.'/../database/migrations' => database_path('migrations'),
// ], 'reports-migration');
$this->publishes([
__DIR__.'/../config/reports.php' => config_path('reports.php'),
], 'reports-migration');
$this->publishes([
__DIR__.'/../resources/lang' => resource_path('lang/vendor/reports'),
], 'reports-migration');
// $this->publishes([
// REPORTS_PATH.'/public' => public_path('vendor/reports'),
// ], 'reports-assets');
// $this->publishes([
// __DIR__.'/../database/seeds' => database_path('seeds'),
// ], 'reports-migration');
$this->publishes([
__DIR__.'/../resources/assets/js/components' => base_path('resources/assets/js/components/reports'),
], 'reports-components');
}
protected function registerRoutes() : void
{
Route::group([
'prefix' => 'reports',
'namespace' => 'agoalofalife\Reports\Http\Controllers',
'middleware' => 'web',
], function () {
$this->loadRoutesFrom(__DIR__.'/../routes/web.php');
});
}
protected function loadViews() : void
{
$this->loadViewsFrom(__DIR__.'/../resources/views', 'reports');
}
}