Passed
Push — master ( effb91...3e9a54 )
by Reza
04:04
created
src/EasyPanelServiceProvider.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
     public function register()
32 32
     {
33 33
         // Here we merge config with 'easy_panel' key
34
-        $this->mergeConfigFrom(__DIR__ . '/../config/easy_panel_config.php', 'easy_panel');
34
+        $this->mergeConfigFrom(__DIR__.'/../config/easy_panel_config.php', 'easy_panel');
35 35
 
36 36
         // Check the status of module
37
-        if(!config('easy_panel.enable')) {
37
+        if (!config('easy_panel.enable')) {
38 38
             return;
39 39
         }
40 40
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
     public function boot()
46 46
     {
47
-        if(!config('easy_panel.enable')) {
47
+        if (!config('easy_panel.enable')) {
48 48
             return;
49 49
         }
50 50
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $this->bindCommands();
58 58
 
59 59
         // Load Views with 'admin::' prefix
60
-        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'admin');
60
+        $this->loadViewsFrom(__DIR__.'/../resources/views', 'admin');
61 61
 
62 62
         // Register Middleware
63 63
         $this->registerMiddlewareAlias();
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
 
77 77
     private function defineRoutes()
78 78
     {
79
-        if(!$this->app->routesAreCached()) {
79
+        if (!$this->app->routesAreCached()) {
80 80
             $middlewares = array_merge(['web', 'isAdmin', 'LangChanger'], config('easy_panel.additional_middlewares'));
81 81
 
82 82
             Route::prefix(config('easy_panel.route_prefix'))
83 83
                 ->middleware($middlewares)
84
-                ->name(getRouteName() . '.')
85
-                ->group(__DIR__ . '/routes.php');
84
+                ->name(getRouteName().'.')
85
+                ->group(__DIR__.'/routes.php');
86 86
         }
87 87
     }
88 88
 
@@ -110,15 +110,15 @@  discard block
 block discarded – undo
110 110
 
111 111
     private function mergePublishes()
112 112
     {
113
-        $this->publishes([__DIR__ . '/../config/easy_panel_config.php' => config_path('easy_panel.php')], 'easy-panel-config');
113
+        $this->publishes([__DIR__.'/../config/easy_panel_config.php' => config_path('easy_panel.php')], 'easy-panel-config');
114 114
 
115
-        $this->publishes([__DIR__ . '/../resources/views' => resource_path('/views/vendor/admin')], 'easy-panel-views');
115
+        $this->publishes([__DIR__.'/../resources/views' => resource_path('/views/vendor/admin')], 'easy-panel-views');
116 116
 
117
-        $this->publishes([__DIR__ . '/../resources/assets' => public_path('/assets/admin')], 'easy-panel-styles');
117
+        $this->publishes([__DIR__.'/../resources/assets' => public_path('/assets/admin')], 'easy-panel-styles');
118 118
 
119 119
         $this->publishes([
120
-            __DIR__ . '/../database/migrations/2021_07_17_999999_create_cruds_table.php' => base_path('/database/migrations/' . date('Y_m_d') . '_999999_create_cruds_table.php'),
121
-            __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')
120
+            __DIR__.'/../database/migrations/2021_07_17_999999_create_cruds_table.php' => base_path('/database/migrations/'.date('Y_m_d').'_999999_create_cruds_table.php'),
121
+            __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')
122 122
         ], 'easy-panel-migration');
123 123
 
124 124
         $this->publishes([__DIR__.'/../resources/lang' => app()->langPath()], 'easy-panel-lang');
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     {
152 152
         $model = !$this->app->runningUnitTests() ? config('easy_panel.user_model') : User::class;
153 153
 
154
-        $model::resolveRelationUsing('panelAdmin', function ($userModel){
154
+        $model::resolveRelationUsing('panelAdmin', function($userModel) {
155 155
             return $userModel->hasOne(PanelAdmin::class)->latest();
156 156
         });
157 157
     }
Please login to merge, or discard this patch.
src/routes.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,19 +26,19 @@  discard block
 block discarded – undo
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
-Route::prefix('crud')->name('crud.')->group(function (){
36
+Route::prefix('crud')->name('crud.')->group(function() {
37 37
     Route::get('/', \EasyPanel\Http\Livewire\CRUD\Lists::class)->name('lists');
38 38
     Route::get('/create', \EasyPanel\Http\Livewire\CRUD\Create::class)->name('create');
39 39
 });
40 40
 
41
-Route::get('setLang', function (){
41
+Route::get('setLang', function() {
42 42
     $lang = request()->get('lang');
43 43
 
44 44
     session()->put('easypanel_lang', $lang);
Please login to merge, or discard this patch.
src/Concerns/Translatable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
     public function addText($text, $key = null)
14 14
     {
15
-        if (array_key_exists($key, $this->texts)){
15
+        if (array_key_exists($key, $this->texts)) {
16 16
             return;
17 17
         }
18 18
 
Please login to merge, or discard this patch.
src/Services/LangService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     {
12 12
         $files = collect(static::getFiles());
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]);
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         foreach (static::getFiles() as $file) {
25 25
             $decodedFile = json_decode(File::get($file), 1);
26 26
             foreach ($texts as $key => $text) {
27
-                if (array_key_exists($key, $decodedFile)){
27
+                if (array_key_exists($key, $decodedFile)) {
28 28
                     unset($texts[$text]);
29 29
                 }
30 30
             }
Please login to merge, or discard this patch.
src/Parsers/HTMLInputs/MultiSelect.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@
 block discarded – undo
14 14
 
15 15
         [$class, $method] = $array;
16 16
 
17
-        if (! class_exists($class)){
17
+        if (!class_exists($class)) {
18 18
             throw new Exception("Class {$class} doesn't exist.");
19 19
         }
20 20
 
21 21
         $method = $method ?: 'handle';
22 22
 
23
-        if (! method_exists($class, $method)){
23
+        if (!method_exists($class, $method)) {
24 24
             throw new Exception("Method {$method} doesn't exist on {$class} class.");
25 25
         }
26 26
 
Please login to merge, or discard this patch.
src/Commands/UserActions/DeleteAdmin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     {
16 16
         $user = $this->argument('user');
17 17
 
18
-        if($this->askResult($user)){
18
+        if ($this->askResult($user)) {
19 19
             UserProviderFacade::deleteAdmin($user);
20 20
             $this->info('Admin was removed successfully');
21 21
             return;
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function askResult($user)
28 28
     {
29
-        if($this->option('force')) {
29
+        if ($this->option('force')) {
30 30
             return true;
31 31
         }
32 32
 
Please login to merge, or discard this patch.