-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAdminServiceProvider.php
More file actions
111 lines (90 loc) · 3.05 KB
/
Copy pathAdminServiceProvider.php
File metadata and controls
111 lines (90 loc) · 3.05 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
namespace Andruby\DeepAdmin;
use Illuminate\Support\Arr;
use Illuminate\Support\ServiceProvider;
use SmallRuralDog\Admin\Admin;
class AdminServiceProvider extends ServiceProvider
{
// protected $commands = [
//
// Console\InstallCommand::class,
// Console\FormItemCommand::class,
// Console\ExtendCommand::class,
//
// ];
//
// protected $routeMiddleware = [
// 'admin.auth' => Middleware\Authenticate::class,
// 'admin.log' => Middleware\LogOperation::class,
// 'admin.permission' => Middleware\Permission::class,
// 'admin.bootstrap' => Middleware\Bootstrap::class,
// 'admin.session' => Middleware\Session::class,
// ];
// /**
// * The application's route middleware groups.
// *
// * @var array
// */
// protected $middlewareGroups = [
// 'admin' => [
// 'admin.auth',
// 'admin.log',
// 'admin.bootstrap',
// 'admin.permission'
// ],
// ];
/**
* Perform post-registration booting of services.
*
* @return void
*/
public function boot()
{
$this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'deep-admin');
$this->loadViewsFrom(__DIR__ . '/../resources/views', 'deep-admin');
$this->loadRoutesFrom(__DIR__ . '/../routes/route.php');
Admin::script('deep-admin', __DIR__.'/../dist/js/extend.js');
Admin::style('deep-admin', __DIR__.'/../dist/css/extend.css');
if (file_exists($routes = app_path('Api') . '/routes.php')) {
$this->loadRoutesFrom($routes);
}
$this->registerPublishing();
}
/**
* Register any package services.
*
* @return void
*/
public function register()
{
$this->mergeConfigFrom(__DIR__ . '/../config/deep_admin.php', 'deep_admin');
$this->loadAdminAuthConfig();
$this->registerRouteMiddleware();
// $this->commands($this->commands);
}
protected function registerPublishing()
{
if ($this->app->runningInConsole()) {
$this->publishes([__DIR__ . '/../config' => config_path()], 'deep-admin-config');
$this->publishes([__DIR__ . '/../resources/lang' => resource_path('lang')], 'deep-admin-lang');
$this->publishes([__DIR__ . '/../database/migrations' => database_path('migrations')], 'deep-admin-migrations');
$this->publishes([__DIR__ . '/../dist' => public_path('vendor/deep-admin')], 'deep-admin-assets');
}
}
protected function loadAdminAuthConfig()
{
// config(Arr::dot(config('admin.auth', []), 'auth.'));
}
protected function registerRouteMiddleware()
{
// // register route middleware.
// foreach ($this->routeMiddleware as $key => $middleware) {
// app('router')->aliasMiddleware($key, $middleware);
// }
//
// // register middleware group.
// foreach ($this->middlewareGroups as $key => $middleware) {
// app('router')->middlewareGroup($key, $middleware);
// }
}
}