@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | public function asImage() |
39 | 39 | { |
40 | - if($this->dataStub != 'linked-image.stub'){ |
|
40 | + if ($this->dataStub != 'linked-image.stub') { |
|
41 | 41 | $this->dataStub = 'image.stub'; |
42 | 42 | } |
43 | 43 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | private function getTitleStubContent() |
166 | 166 | { |
167 | - if ($this->isRelational()){ |
|
167 | + if ($this->isRelational()) { |
|
168 | 168 | return file_get_contents(__DIR__.'/stubs/titles/not-sortable.stub'); |
169 | 169 | } |
170 | 170 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | return \Str::contains($this->key, '.'); |
177 | 177 | } |
178 | 178 | |
179 | - private function parseRelationalKey($key){ |
|
179 | + private function parseRelationalKey($key) { |
|
180 | 180 | return str_replace('.', '->', $key); |
181 | 181 | } |
182 | 182 |
@@ -15,11 +15,11 @@ |
||
15 | 15 | |
16 | 16 | auth()->shouldUse($defaultGuard); |
17 | 17 | |
18 | - if(auth()->guest()){ |
|
18 | + if (auth()->guest()) { |
|
19 | 19 | return redirect($redirectPath); |
20 | 20 | } |
21 | 21 | |
22 | - if(!AuthFacade::check(auth()->user()->id)){ |
|
22 | + if (!AuthFacade::check(auth()->user()->id)) { |
|
23 | 23 | return redirect($redirectPath); |
24 | 24 | } |
25 | 25 |
@@ -2,8 +2,8 @@ discard block |
||
2 | 2 | |
3 | 3 | use EasyPanel\Contracts\CRUDComponent; |
4 | 4 | |
5 | -if(! function_exists('getRouteName')) { |
|
6 | - function getRouteName(){ |
|
5 | +if (!function_exists('getRouteName')) { |
|
6 | + function getRouteName() { |
|
7 | 7 | $routeName = config('easy_panel.route_prefix'); |
8 | 8 | $routeName = trim($routeName, '/'); |
9 | 9 | $routeName = str_replace('/', '.', $routeName); |
@@ -11,19 +11,19 @@ discard block |
||
11 | 11 | } |
12 | 12 | } |
13 | 13 | |
14 | -if(! function_exists('getCrudConfig')) { |
|
15 | - function getCrudConfig($name){ |
|
14 | +if (!function_exists('getCrudConfig')) { |
|
15 | + function getCrudConfig($name) { |
|
16 | 16 | |
17 | - $crudName=ucfirst($name); |
|
17 | + $crudName = ucfirst($name); |
|
18 | 18 | $namespace = "\\App\\CRUD\\{$crudName}Component"; |
19 | 19 | |
20 | - if (!file_exists(app_path("/CRUD/{$crudName}Component.php")) or !class_exists($namespace)){ |
|
20 | + if (!file_exists(app_path("/CRUD/{$crudName}Component.php")) or !class_exists($namespace)) { |
|
21 | 21 | abort(403, "Class with {$namespace} namespace doesn't exist"); |
22 | 22 | } |
23 | 23 | |
24 | 24 | $instance = app()->make($namespace); |
25 | 25 | |
26 | - if (!$instance instanceof CRUDComponent){ |
|
26 | + if (!$instance instanceof CRUDComponent) { |
|
27 | 27 | abort(403, "{$namespace} should implement CRUDComponent interface"); |
28 | 28 | } |
29 | 29 | |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
34 | -if(! function_exists('crud')) { |
|
35 | - function crud($name){ |
|
34 | +if (!function_exists('crud')) { |
|
35 | + function crud($name) { |
|
36 | 36 | return \EasyPanel\Models\CRUD::query()->where('name', $name)->first(); |
37 | 37 | } |
38 | 38 | } |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | Route::view('/', "admin::home")->name('home'); |
6 | 6 | |
7 | -Route::post('/logout', function (){ |
|
7 | +Route::post('/logout', function() { |
|
8 | 8 | auth()->logout(); |
9 | 9 | return redirect(config('easy_panel.redirect_unauthorized')); |
10 | 10 | })->name('logout'); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $name = ucfirst($crud->name); |
16 | 16 | $component = "App\\Http\\Livewire\\Admin\\$name"; |
17 | 17 | |
18 | - Route::prefix($crud->route)->name("{$crud->route}.")->group(function () use ($component, $crud, $crudConfig) { |
|
18 | + Route::prefix($crud->route)->name("{$crud->route}.")->group(function() use ($component, $crud, $crudConfig) { |
|
19 | 19 | |
20 | 20 | if (@class_exists("$component\\Read")) { |
21 | 21 | Route::get('/', "$component\\Read")->name('read'); |
@@ -26,26 +26,26 @@ discard block |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | if (@$crudConfig->update and @class_exists("$component\\Update")) { |
29 | - Route::get('/update/{' . $crud->name . '}', "$component\\Update")->name('update'); |
|
29 | + Route::get('/update/{'.$crud->name.'}', "$component\\Update")->name('update'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | }); |
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | -if(config('easy_panel.todo')){ |
|
37 | - Route::prefix('todo')->name('todo.')->group(function (){ |
|
36 | +if (config('easy_panel.todo')) { |
|
37 | + Route::prefix('todo')->name('todo.')->group(function() { |
|
38 | 38 | Route::get('/', \EasyPanel\Http\Livewire\Todo\Lists::class)->name('lists'); |
39 | 39 | Route::get('/create', \EasyPanel\Http\Livewire\Todo\Create::class)->name('create'); |
40 | 40 | }); |
41 | 41 | } |
42 | 42 | |
43 | -Route::prefix('crud')->name('crud.')->group(function (){ |
|
43 | +Route::prefix('crud')->name('crud.')->group(function() { |
|
44 | 44 | Route::get('/', \EasyPanel\Http\Livewire\CRUD\Lists::class)->name('lists'); |
45 | 45 | Route::get('/create', \EasyPanel\Http\Livewire\CRUD\Create::class)->name('create'); |
46 | 46 | }); |
47 | 47 | |
48 | -Route::get('setLang', function (){ |
|
48 | +Route::get('setLang', function() { |
|
49 | 49 | $lang = request()->get('lang'); |
50 | 50 | |
51 | 51 | session()->put('easypanel_lang', $lang); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | { |
14 | 14 | $lang = session()->has('easypanel_lang') |
15 | 15 | ? session()->get('easypanel_lang') |
16 | - : (config('easy_panel.lang') ?? 'en') .'_panel'; |
|
16 | + : (config('easy_panel.lang') ?? 'en').'_panel'; |
|
17 | 17 | |
18 | 18 | App::setLocale($lang); |
19 | 19 |
@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | $files = collect(File::glob(resource_path('lang/*_panel.json'))); |
13 | 13 | |
14 | - return $files->mapWithKeys(function ($file, $key){ |
|
14 | + return $files->mapWithKeys(function($file, $key) { |
|
15 | 15 | preg_match('/(\w+)_panel\.json/i', $file, $m); |
16 | 16 | $key = "$m[1]_panel"; |
17 | 17 | $value = Str::upper($m[1]); |