|
@@ -34,10 +34,10 @@ discard block |
|
|
block discarded – undo |
|
34
|
34
|
public function register() |
|
35
|
35
|
{ |
|
36
|
36
|
// Here we merge config with 'easy_panel' key |
|
37
|
|
- $this->mergeConfigFrom(__DIR__ . '/../config/easy_panel_config.php', 'easy_panel'); |
|
|
37
|
+ $this->mergeConfigFrom(__DIR__.'/../config/easy_panel_config.php', 'easy_panel'); |
|
38
|
38
|
|
|
39
|
39
|
// Check the status of module |
|
40
|
|
- if(!config('easy_panel.enable')) { |
|
|
40
|
+ if (!config('easy_panel.enable')) { |
|
41
|
41
|
return; |
|
42
|
42
|
} |
|
43
|
43
|
|
|
@@ -47,7 +47,7 @@ discard block |
|
|
block discarded – undo |
|
47
|
47
|
|
|
48
|
48
|
public function boot() |
|
49
|
49
|
{ |
|
50
|
|
- if(!config('easy_panel.enable')) { |
|
|
50
|
+ if (!config('easy_panel.enable')) { |
|
51
|
51
|
return; |
|
52
|
52
|
} |
|
53
|
53
|
|
|
@@ -60,7 +60,7 @@ discard block |
|
|
block discarded – undo |
|
60
|
60
|
$this->bindCommands(); |
|
61
|
61
|
|
|
62
|
62
|
// Load Views with 'admin::' prefix |
|
63
|
|
- $this->loadViewsFrom(__DIR__ . '/../resources/views', 'admin'); |
|
|
63
|
+ $this->loadViewsFrom(__DIR__.'/../resources/views', 'admin'); |
|
64
|
64
|
|
|
65
|
65
|
// Register Middleware |
|
66
|
66
|
$this->registerMiddlewareAlias(); |
|
@@ -79,13 +79,13 @@ discard block |
|
|
block discarded – undo |
|
79
|
79
|
|
|
80
|
80
|
private function defineRoutes() |
|
81
|
81
|
{ |
|
82
|
|
- if(!$this->app->routesAreCached()) { |
|
|
82
|
+ if (!$this->app->routesAreCached()) { |
|
83
|
83
|
$middlewares = array_merge(['web', 'isAdmin', 'LangChanger'], config('easy_panel.additional_middlewares')); |
|
84
|
84
|
|
|
85
|
85
|
Route::prefix(config('easy_panel.route_prefix')) |
|
86
|
86
|
->middleware($middlewares) |
|
87
|
|
- ->name(getRouteName() . '.') |
|
88
|
|
- ->group(__DIR__ . '/routes.php'); |
|
|
87
|
+ ->name(getRouteName().'.') |
|
|
88
|
+ ->group(__DIR__.'/routes.php'); |
|
89
|
89
|
} |
|
90
|
90
|
} |
|
91
|
91
|
|
|
@@ -117,17 +117,17 @@ discard block |
|
|
block discarded – undo |
|
117
|
117
|
|
|
118
|
118
|
private function mergePublishes() |
|
119
|
119
|
{ |
|
120
|
|
- $this->publishes([__DIR__ . '/../config/easy_panel_config.php' => config_path('easy_panel.php')], 'easy-panel-config'); |
|
|
120
|
+ $this->publishes([__DIR__.'/../config/easy_panel_config.php' => config_path('easy_panel.php')], 'easy-panel-config'); |
|
121
|
121
|
|
|
122
|
|
- $this->publishes([__DIR__ . '/../resources/views' => resource_path('/views/vendor/admin')], 'easy-panel-views'); |
|
|
122
|
+ $this->publishes([__DIR__.'/../resources/views' => resource_path('/views/vendor/admin')], 'easy-panel-views'); |
|
123
|
123
|
|
|
124
|
|
- $this->publishes([__DIR__ . '/../resources/assets' => public_path('/assets/admin')], 'easy-panel-styles'); |
|
|
124
|
+ $this->publishes([__DIR__.'/../resources/assets' => public_path('/assets/admin')], 'easy-panel-styles'); |
|
125
|
125
|
|
|
126
|
|
- $this->publishes([__DIR__ . '/../database/migrations/2020_09_05_999999_create_todos_table.php' => base_path('/database/migrations/' . date('Y_m_d') . '_999999_create_admin_todos_table.php')], 'easy-panel-todo'); |
|
|
126
|
+ $this->publishes([__DIR__.'/../database/migrations/2020_09_05_999999_create_todos_table.php' => base_path('/database/migrations/'.date('Y_m_d').'_999999_create_admin_todos_table.php')], 'easy-panel-todo'); |
|
127
|
127
|
|
|
128
|
128
|
$this->publishes([ |
|
129
|
|
- __DIR__ . '/../database/migrations/2021_07_17_999999_create_cruds_table.php' => base_path('/database/migrations/' . date('Y_m_d') . '_999999_create_cruds_table.php'), |
|
130
|
|
- __DIR__ . '/../database/migrations/2021_12_17_999999_create_user_admins_table.php' => base_path('/database/migrations/' . date('Y_m_d') . '_999999_create_user_admins_table.php') |
|
|
129
|
+ __DIR__.'/../database/migrations/2021_07_17_999999_create_cruds_table.php' => base_path('/database/migrations/'.date('Y_m_d').'_999999_create_cruds_table.php'), |
|
|
130
|
+ __DIR__.'/../database/migrations/2021_12_17_999999_create_user_admins_table.php' => base_path('/database/migrations/'.date('Y_m_d').'_999999_create_user_admins_table.php') |
|
131
|
131
|
], 'easy-panel-migration'); |
|
132
|
132
|
|
|
133
|
133
|
$this->publishes([__DIR__.'/../resources/lang' => app()->langPath()], 'easy-panel-lang'); |
|
@@ -160,7 +160,7 @@ discard block |
|
|
block discarded – undo |
|
160
|
160
|
{ |
|
161
|
161
|
$model = !$this->app->runningUnitTests() ? config('easy_panel.user_model') : User::class; |
|
162
|
162
|
|
|
163
|
|
- $model::resolveRelationUsing('panelAdmin', function ($userModel){ |
|
|
163
|
+ $model::resolveRelationUsing('panelAdmin', function($userModel) { |
|
164
|
164
|
return $userModel->hasOne(PanelAdmin::class)->latest(); |
|
165
|
165
|
}); |
|
166
|
166
|
} |