Passed
Push — main ( f6546c...ea673e )
by PRATIK
12:38
created
src/Providers/AdmineticServiceProvider.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -126,26 +126,26 @@  discard block
 block discarded – undo
126 126
     {
127 127
         // Publish Config File
128 128
         $this->publishes([
129
-            __DIR__ . '/../../config/adminetic.php' => config_path('adminetic.php'),
129
+            __DIR__.'/../../config/adminetic.php' => config_path('adminetic.php'),
130 130
         ], 'adminetic-config');
131 131
         // Publish View Files
132 132
         $this->publishes([
133
-            __DIR__ . '/../../resources/views' => resource_path('views/vendor/adminetic'),
133
+            __DIR__.'/../../resources/views' => resource_path('views/vendor/adminetic'),
134 134
         ], 'adminetic-views');
135 135
         // Publish Migration Files
136 136
         $this->publishes([
137
-            __DIR__ . '/../../database/migrations' => database_path('migrations'),
137
+            __DIR__.'/../../database/migrations' => database_path('migrations'),
138 138
         ], 'adminetic-migrations');
139 139
         // Publish Database Seeds
140 140
         $this->publishes([
141
-            __DIR__ . '/../../database/seeders' => database_path('seeders'),
141
+            __DIR__.'/../../database/seeders' => database_path('seeders'),
142 142
         ], 'adminetic-seeders');
143 143
         $this->publishes([
144
-            __DIR__ . '/../../payload/assets' => public_path('adminetic/assets'),
144
+            __DIR__.'/../../payload/assets' => public_path('adminetic/assets'),
145 145
         ], 'adminetic-assets-files');
146 146
         // Publish Static Files
147 147
         $this->publishes([
148
-            __DIR__ . '/../../payload/static' => public_path('adminetic/static'),
148
+            __DIR__.'/../../payload/static' => public_path('adminetic/static'),
149 149
         ], 'adminetic-static-files');
150 150
     }
151 151
 
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
      */
157 157
     protected function registerResource()
158 158
     {
159
-        $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations'); // Loading Migration Files
160
-        $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'adminetic'); // Loading Views Files
159
+        $this->loadMigrationsFrom(__DIR__.'/../../database/migrations'); // Loading Migration Files
160
+        $this->loadViewsFrom(__DIR__.'/../../resources/views', 'adminetic'); // Loading Views Files
161 161
         $this->registerRoutes();
162 162
     }
163 163
 
@@ -168,8 +168,8 @@  discard block
 block discarded – undo
168 168
      */
169 169
     protected function registerRoutes()
170 170
     {
171
-        Route::group($this->routeConfiguration(), function () {
172
-            $this->loadRoutesFrom(__DIR__ . '/../../routes/web.php');
171
+        Route::group($this->routeConfiguration(), function() {
172
+            $this->loadRoutesFrom(__DIR__.'/../../routes/web.php');
173 173
         });
174 174
     }
175 175
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      */
213 213
     protected function directives()
214 214
     {
215
-        Blade::if('hasRole', function ($roles) {
215
+        Blade::if ('hasRole', function($roles) {
216 216
             $hasAccess = false;
217 217
             $roles_array = explode('|', $roles);
218 218
             foreach ($roles_array as $role) {
@@ -221,10 +221,10 @@  discard block
 block discarded – undo
221 221
 
222 222
             return $hasAccess;
223 223
         });
224
-        Blade::if('preference', function ($preference_name, $default_value) {
224
+        Blade::if ('preference', function($preference_name, $default_value) {
225 225
             return preference($preference_name, $default_value);
226 226
         });
227
-        Blade::directive('setting', function ($setting_name) {
227
+        Blade::directive('setting', function($setting_name) {
228 228
             return "<?php echo setting($setting_name) ?>";
229 229
         });
230 230
     }
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
      */
304 304
     protected function getFacades()
305 305
     {
306
-        $this->app->bind('adminetic', function ($app) {
306
+        $this->app->bind('adminetic', function($app) {
307 307
             return new Adminetic();
308 308
         });
309 309
     }
Please login to merge, or discard this patch.
src/Models/Admin/Setting.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
     {
19 19
         parent::boot();
20 20
 
21
-        static::saving(function () {
21
+        static::saving(function() {
22 22
             self::cacheKey();
23 23
         });
24 24
 
25
-        static::deleting(function () {
25
+        static::deleting(function() {
26 26
             self::cacheKey();
27 27
         });
28 28
     }
@@ -30,8 +30,7 @@  discard block
 block discarded – undo
30 30
     // Cache Keys
31 31
     private static function cacheKey()
32 32
     {
33
-        Cache::has('settings') ? Cache::forget('settings') :
34
-            Cache::rememberForever('settings', function () {
33
+        Cache::has('settings') ? Cache::forget('settings') : Cache::rememberForever('settings', function() {
35 34
                 return Setting::all();
36 35
             });
37 36
     }
Please login to merge, or discard this patch.
src/Helpers/AdminHelper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     {
75 75
         $profile = $p ?? Auth::user()->profile ?? Auth::user()->profile()->create();
76 76
 
77
-        return isset($profile->profile_pic) ? (Illuminate\Support\Str::contains($profile->profile_pic, ['https://', 'http://']) ? $profile->profile_pic : asset('storage/' . $profile->profile_pic)) : asset(config('adminetic.profile_placeholder', 'adminetic/static/profile.gif'));
77
+        return isset($profile->profile_pic) ? (Illuminate\Support\Str::contains($profile->profile_pic, ['https://', 'http://']) ? $profile->profile_pic : asset('storage/'.$profile->profile_pic)) : asset(config('adminetic.profile_placeholder', 'adminetic/static/profile.gif'));
78 78
     }
79 79
 }
80 80
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 if (!function_exists('random_color')) {
159 159
     function random_color()
160 160
     {
161
-        return random_color_part() . random_color_part() . random_color_part();
161
+        return random_color_part().random_color_part().random_color_part();
162 162
     }
163 163
 }
164 164
 
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
         $valid_setting_name = strtolower(str_replace(' ', '_', $setting_name));
169 169
         $settings = Cache::has('settings') ?
170 170
             Cache::get('settings')
171
-            : Cache::rememberForever('settings', function () {
171
+            : Cache::rememberForever('settings', function() {
172 172
                 return Setting::all();
173 173
             });
174
-        $setting = $settings->first(function ($s) use ($valid_setting_name) {
174
+        $setting = $settings->first(function($s) use ($valid_setting_name) {
175 175
             return $s->getRawOriginal('setting_name') == $valid_setting_name;
176 176
         });
177 177
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 if (!function_exists('deleteImage')) {
198 198
     function deleteImage($image)
199 199
     {
200
-        $image ? (\Illuminate\Support\Facades\File::exists(public_path('storage/' . $image)) ? \Illuminate\Support\Facades\File::delete(public_path('storage/' . $image)) : '') : '';
200
+        $image ? (\Illuminate\Support\Facades\File::exists(public_path('storage/'.$image)) ? \Illuminate\Support\Facades\File::delete(public_path('storage/'.$image)) : '') : '';
201 201
     }
202 202
 }
203 203
 
@@ -256,8 +256,8 @@  discard block
 block discarded – undo
256 256
     function getImg($img, $default)
257 257
     {
258 258
         if (isset($img)) {
259
-            if (file_exists(public_path('storage/' . $img))) {
260
-                return asset('storage/' . $img);
259
+            if (file_exists(public_path('storage/'.$img))) {
260
+                return asset('storage/'.$img);
261 261
             } elseif (file_exists(public_path($img))) {
262 262
                 return asset($img);
263 263
             } else {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 if (!function_exists('putContentToClassFunction')) {
273 273
     function putContentToClassFunction($file, $function_name, $data, $closing_token = '}')
274 274
     {
275
-        $data = $data . "\n";
275
+        $data = $data."\n";
276 276
         // Read the contents of the file into a string
277 277
         $contents = file_get_contents($file);
278 278
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         $function_definition = substr($contents, $start_pos, $end_pos - $start_pos + 1);
293 293
 
294 294
         // Append the new content to the function definition
295
-        $modified_function_definition = rtrim($function_definition, $closing_token) . $data . $closing_token;
295
+        $modified_function_definition = rtrim($function_definition, $closing_token).$data.$closing_token;
296 296
 
297 297
         // Replace the original function definition with the modified one in the class definition
298 298
         $modified_contents = substr_replace($contents, $modified_function_definition, $start_pos, $end_pos - $start_pos + 1);
Please login to merge, or discard this patch.