Passed
Push — master ( 0c3872...7a99d2 )
by Reza
03:59
created
src/Support/User/UserProvider.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
         $user = $this->findUser($id);
13 13
         $modelInstance = app()->make(config('easy_panel.user_model'));
14 14
         $column = config('easy_panel.column');
15
-        if(in_array($column, $modelInstance->getFillable()) or !in_array($column, $modelInstance->getGuarded()))  {
15
+        if (in_array($column, $modelInstance->getFillable()) or !in_array($column, $modelInstance->getGuarded())) {
16 16
             $user->update([
17 17
                 config('easy_panel.column') => 1
18 18
             ]);
Please login to merge, or discard this patch.
src/routes.php 1 patch
Spacing   +6 added lines, -6 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,20 +26,20 @@  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
-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
 });
Please login to merge, or discard this patch.
src/EasyPanelServiceProvider.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
     public function register()
37 37
     {
38 38
         // Here we merge config with 'easy_panel' key
39
-        $this->mergeConfigFrom(__DIR__ . '/../config/easy_panel_config.php', 'easy_panel');
39
+        $this->mergeConfigFrom(__DIR__.'/../config/easy_panel_config.php', 'easy_panel');
40 40
 
41 41
         // Check the status of module
42
-        if(!config('easy_panel.enable')) {
42
+        if (!config('easy_panel.enable')) {
43 43
             return;
44 44
         }
45 45
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     public function boot()
51 51
     {
52
-        if(!config('easy_panel.enable')) {
52
+        if (!config('easy_panel.enable')) {
53 53
             return;
54 54
         }
55 55
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $this->bindCommands();
63 63
 
64 64
         // Load Views with 'admin::' prefix
65
-        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'admin');
65
+        $this->loadViewsFrom(__DIR__.'/../resources/views', 'admin');
66 66
 
67 67
         // Register Middleware
68 68
         $this->registerMiddlewareAlias();
@@ -76,11 +76,11 @@  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
             Route::prefix(config('easy_panel.route_prefix'))
81 81
                 ->middleware(['web', 'isAdmin', 'LangChanger'])
82
-                ->name(getRouteName() . '.')
83
-                ->group(__DIR__ . '/routes.php');
82
+                ->name(getRouteName().'.')
83
+                ->group(__DIR__.'/routes.php');
84 84
         }
85 85
     }
86 86
 
@@ -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
-        $this->publishes([__DIR__ . '/../database/migrations/2020_09_05_99999_create_todos_table.php' => base_path('/database/migrations/' . date('Y_m_d') . '_99999_create_admin_todos_table.php')], 'easy-panel-todo');
119
+        $this->publishes([__DIR__.'/../database/migrations/2020_09_05_99999_create_todos_table.php' => base_path('/database/migrations/'.date('Y_m_d').'_99999_create_admin_todos_table.php')], 'easy-panel-todo');
120 120
 
121
-        $this->publishes([__DIR__ . '/../database/migrations/2021_07_17_99999_create_cruds_table.php' => base_path('/database/migrations/' . date('Y_m_d') . '_99999_create_cruds_table.php')], 'easy-panel-migration');
121
+        $this->publishes([__DIR__.'/../database/migrations/2021_07_17_99999_create_cruds_table.php' => base_path('/database/migrations/'.date('Y_m_d').'_99999_create_cruds_table.php')], 'easy-panel-migration');
122 122
 
123 123
         $this->publishes([__DIR__.'/../resources/lang' => resource_path('/lang')], 'easy-panel-lang');
124 124
 
Please login to merge, or discard this patch.
src/Http/Livewire/CRUD/Single.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         ]);
25 25
 
26 26
         $this->crud->delete();
27
-        $this->dispatchBrowserEvent('show-message', ['type' => 'error', 'message' => __('DeletedMessage', ['name' => __('Todo') ] )]);
27
+        $this->dispatchBrowserEvent('show-message', ['type' => 'error', 'message' => __('DeletedMessage', ['name' => __('Todo')])]);
28 28
         $this->emit('crudUpdated');
29 29
     }
30 30
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             'built' => true
40 40
         ]);
41 41
 
42
-        $this->dispatchBrowserEvent('show-message', ['type' => 'success', 'message' => __('CRUD Created successfully') ] );
42
+        $this->dispatchBrowserEvent('show-message', ['type' => 'success', 'message' => __('CRUD Created successfully')]);
43 43
         $this->emit('crudUpdated');
44 44
     }
45 45
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             'active' => false
50 50
         ]);
51 51
 
52
-        $this->dispatchBrowserEvent('show-message', ['type' => 'success', 'message' => __('CRUD was inactivated') ] );
52
+        $this->dispatchBrowserEvent('show-message', ['type' => 'success', 'message' => __('CRUD was inactivated')]);
53 53
         $this->emit('crudUpdated');
54 54
     }
55 55
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             'active' => true
60 60
         ]);
61 61
 
62
-        $this->dispatchBrowserEvent('show-message', ['type' => 'success', 'message' => __('CRUD was activated') ] );
62
+        $this->dispatchBrowserEvent('show-message', ['type' => 'success', 'message' => __('CRUD was activated')]);
63 63
         $this->emit('crudUpdated');
64 64
     }
65 65
 
Please login to merge, or discard this patch.
src/Commands/CRUDActions/CommandBase.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@
 block discarded – undo
99 99
         ];
100 100
     }
101 101
 
102
-    private function setCRUDInstance(){
102
+    private function setCRUDInstance() {
103 103
         $modelName = $this->getNameInput();
104 104
 
105 105
         return $this->crudInstance = getCrudConfig($modelName);
Please login to merge, or discard this patch.
src/Commands/Actions/Uninstall.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
             ? true
18 18
             : $this->confirm("Do you really want to uninstall the panel ? (All files and components will be deleted)", true);
19 19
 
20
-        if($status){
20
+        if ($status) {
21 21
             File::deleteDirectory(app_path('Http/Livewire/Admin'));
22 22
             File::deleteDirectory(app_path('CRUD'));
23 23
             File::deleteDirectory(resource_path('views/livewire/admin'));
Please login to merge, or discard this patch.
src/Commands/Actions/MakeCRUD.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,10 +15,9 @@
 block discarded – undo
15 15
     public function handle()
16 16
     {
17 17
         $names = $this->argument('name') ?
18
-            [$this->argument('name')] :
19
-            CRUD::query()->where('active', true)->pluck('name')->toArray();
18
+            [$this->argument('name')] : CRUD::query()->where('active', true)->pluck('name')->toArray();
20 19
 
21
-        if(is_null($names)) {
20
+        if (is_null($names)) {
22 21
             throw new CommandNotFoundException("There is no action in config file");
23 22
         }
24 23
 
Please login to merge, or discard this patch.
database/migrations/2021_07_17_99999_create_cruds_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('cruds', function (Blueprint $table) {
16
+        Schema::create('cruds', function(Blueprint $table) {
17 17
             $table->id();
18 18
             $table->string('name')->unique();
19 19
             $table->string('model')->unique();
Please login to merge, or discard this patch.
src/Commands/Actions/MakeCRUDConfig.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
         $path = base_path("app/CRUD/{$name}Component.php");
26 26
 
27
-        if($this->files->exists($path) and !$this->option('force')){
27
+        if ($this->files->exists($path) and !$this->option('force')) {
28 28
             $this->warn("'{$name}Component.php' already exists in CRUD directory");
29 29
             return;
30 30
         }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $model = $this->qualifyModel($this->getNameInput());
63 63
 
64
-        if(!class_exists($model)){
64
+        if (!class_exists($model)) {
65 65
             $this->warn("Model option should be valid and model should be exist");
66 66
             die();
67 67
         }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     private function withAuth()
73 73
     {
74 74
         $fillableList = $this->getFillableList();
75
-        if(!in_array('user_id', $fillableList)){
75
+        if (!in_array('user_id', $fillableList)) {
76 76
             return 'true';
77 77
         }
78 78
 
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
     {
91 91
         $fillableList = $this->getFillableList();
92 92
         $array = [];
93
-        foreach ($fillableList as $fillable){
94
-            if(!Str::contains($fillable, 'id')){
93
+        foreach ($fillableList as $fillable) {
94
+            if (!Str::contains($fillable, 'id')) {
95 95
                 $array[] = "'$fillable'";
96 96
             }
97 97
         }
Please login to merge, or discard this patch.