@@ -67,27 +67,27 @@ discard block |
||
| 67 | 67 | function getProfilePlaceholder($p = null) |
| 68 | 68 | { |
| 69 | 69 | $profile = $p ?? Auth::user()->profile; |
| 70 | - return isset($profile->profile_pic) ? (Illuminate\Support\Str::contains($profile->profile_pic, ['https://', 'http://']) ? $profile->profile_pic : asset('storage/' . $profile->profile_pic)) : asset('adminetic/static/profile.jpg'); |
|
| 70 | + return isset($profile->profile_pic) ? (Illuminate\Support\Str::contains($profile->profile_pic, ['https://', 'http://']) ? $profile->profile_pic : asset('storage/'.$profile->profile_pic)) : asset('adminetic/static/profile.jpg'); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | if (!function_exists('getFavicon')) { |
| 75 | 75 | function getFavicon() |
| 76 | 76 | { |
| 77 | - return setting('favicon') ? (asset('storage/' . setting('favicon'))) : 'adminetic/static/favicon.png'; |
|
| 77 | + return setting('favicon') ? (asset('storage/'.setting('favicon'))) : 'adminetic/static/favicon.png'; |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | if (!function_exists('getLogo')) { |
| 81 | 81 | function getLogo() |
| 82 | 82 | { |
| 83 | - return setting('logo') ? (asset('storage/' . setting('logo'))) : 'adminetic/static/logo.png'; |
|
| 83 | + return setting('logo') ? (asset('storage/'.setting('logo'))) : 'adminetic/static/logo.png'; |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | if (!function_exists('getLogoBanner')) { |
| 88 | 88 | function getLogoBanner() |
| 89 | 89 | { |
| 90 | - return setting('logo_banner') ? (asset('storage/' . setting('logo_banner'))) : 'adminetic/static/logo_banner.jpg'; |
|
| 90 | + return setting('logo_banner') ? (asset('storage/'.setting('logo_banner'))) : 'adminetic/static/logo_banner.jpg'; |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | if (!function_exists('random_color')) { |
| 109 | 109 | function random_color() |
| 110 | 110 | { |
| 111 | - return random_color_part() . random_color_part() . random_color_part(); |
|
| 111 | + return random_color_part().random_color_part().random_color_part(); |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
@@ -124,26 +124,26 @@ discard block |
||
| 124 | 124 | { |
| 125 | 125 | // Publish Config File |
| 126 | 126 | $this->publishes([ |
| 127 | - __DIR__ . '/../../config/adminetic.php' => config_path('adminetic.php'), |
|
| 127 | + __DIR__.'/../../config/adminetic.php' => config_path('adminetic.php'), |
|
| 128 | 128 | ], 'adminetic-config'); |
| 129 | 129 | // Publish View Files |
| 130 | 130 | $this->publishes([ |
| 131 | - __DIR__ . '/../../resources/views' => resource_path('views/vendor/adminetic'), |
|
| 131 | + __DIR__.'/../../resources/views' => resource_path('views/vendor/adminetic'), |
|
| 132 | 132 | ], 'adminetic-views'); |
| 133 | 133 | // Publish Migration Files |
| 134 | 134 | $this->publishes([ |
| 135 | - __DIR__ . '/../../database/migrations' => database_path('migrations'), |
|
| 135 | + __DIR__.'/../../database/migrations' => database_path('migrations'), |
|
| 136 | 136 | ], 'adminetic-migrations'); |
| 137 | 137 | // Publish Database Seeds |
| 138 | 138 | $this->publishes([ |
| 139 | - __DIR__ . '/../../database/seeders' => database_path('seeders'), |
|
| 139 | + __DIR__.'/../../database/seeders' => database_path('seeders'), |
|
| 140 | 140 | ], 'adminetic-seeders'); |
| 141 | 141 | $this->publishes([ |
| 142 | - __DIR__ . '/../../payload/assets' => public_path('adminetic/assets'), |
|
| 142 | + __DIR__.'/../../payload/assets' => public_path('adminetic/assets'), |
|
| 143 | 143 | ], 'adminetic-assets-files'); |
| 144 | 144 | // Publish Static Files |
| 145 | 145 | $this->publishes([ |
| 146 | - __DIR__ . '/../../payload/static' => public_path('adminetic/static'), |
|
| 146 | + __DIR__.'/../../payload/static' => public_path('adminetic/static'), |
|
| 147 | 147 | ], 'adminetic-static-files'); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -156,8 +156,8 @@ discard block |
||
| 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 | |
@@ -170,8 +170,8 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | protected function registerRoutes() |
| 172 | 172 | { |
| 173 | - Route::group($this->routeConfiguration(), function () { |
|
| 174 | - $this->loadRoutesFrom(__DIR__ . '/../../routes/web.php'); |
|
| 173 | + Route::group($this->routeConfiguration(), function() { |
|
| 174 | + $this->loadRoutesFrom(__DIR__.'/../../routes/web.php'); |
|
| 175 | 175 | }); |
| 176 | 176 | } |
| 177 | 177 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | */ |
| 221 | 221 | protected function directives() |
| 222 | 222 | { |
| 223 | - Blade::if('hasRole', function ($roles) { |
|
| 223 | + Blade::if ('hasRole', function($roles) { |
|
| 224 | 224 | $hasAccess = false; |
| 225 | 225 | $roles_array = explode("|", $roles); |
| 226 | 226 | foreach ($roles_array as $role) { |
@@ -228,10 +228,10 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | return $hasAccess; |
| 230 | 230 | }); |
| 231 | - Blade::if('preference', function ($preference_name, $default_value) { |
|
| 231 | + Blade::if ('preference', function($preference_name, $default_value) { |
|
| 232 | 232 | return preference($preference_name, $default_value); |
| 233 | 233 | }); |
| 234 | - Blade::directive('setting', function ($setting_name) { |
|
| 234 | + Blade::directive('setting', function($setting_name) { |
|
| 235 | 235 | return "<?php echo setting($setting_name) ?>"; |
| 236 | 236 | }); |
| 237 | 237 | } |
@@ -66,6 +66,6 @@ |
||
| 66 | 66 | |
| 67 | 67 | protected static function makeRequest($name) |
| 68 | 68 | { |
| 69 | - Artisan::call('make:request ' . $name . 'Request'); |
|
| 69 | + Artisan::call('make:request '.$name.'Request'); |
|
| 70 | 70 | } |
| 71 | 71 | } |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | protected static function makeViews($name, $console) |
| 69 | 69 | { |
| 70 | 70 | $lowername = strtolower($name); |
| 71 | - if (!file_exists($path = resource_path('views/admin/' . $lowername))) { |
|
| 71 | + if (!file_exists($path = resource_path('views/admin/'.$lowername))) { |
|
| 72 | 72 | mkdir($path, 0777, true); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if (!file_exists($path = resource_path('views/admin/layouts/modules/' . $lowername))) { |
|
| 75 | + if (!file_exists($path = resource_path('views/admin/layouts/modules/'.$lowername))) { |
|
| 76 | 76 | mkdir($path, 0777, true); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -152,25 +152,25 @@ discard block |
||
| 152 | 152 | // Make Other neccesary CRUD files |
| 153 | 153 | protected static function makeOthers($name, $console) |
| 154 | 154 | { |
| 155 | - Artisan::call('make:migration create_' . strtolower(Str::plural($name)) . '_table --create=' . strtolower(Str::plural($name))); |
|
| 156 | - $console->info("Migration file created named create_" . strtolower(Str::plural($name)) . "_table ... ✅"); |
|
| 155 | + Artisan::call('make:migration create_'.strtolower(Str::plural($name)).'_table --create='.strtolower(Str::plural($name))); |
|
| 156 | + $console->info("Migration file created named create_".strtolower(Str::plural($name))."_table ... ✅"); |
|
| 157 | 157 | |
| 158 | - Artisan::call('make:seeder ' . $name . 'Seeder'); |
|
| 158 | + Artisan::call('make:seeder '.$name.'Seeder'); |
|
| 159 | 159 | $console->info("Seeder file created ... ✅"); |
| 160 | 160 | |
| 161 | - Artisan::call('make:repo ' . $name); |
|
| 161 | + Artisan::call('make:repo '.$name); |
|
| 162 | 162 | $console->info("Repository and Interface created ... ✅"); |
| 163 | 163 | |
| 164 | - Artisan::call('make:request ' . $name . 'Request'); |
|
| 164 | + Artisan::call('make:request '.$name.'Request'); |
|
| 165 | 165 | $console->info("Request file created ... ✅"); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | protected static function fileMadeSuccess($console, $file, $type) |
| 169 | 169 | { |
| 170 | 170 | if (file_exists($file)) { |
| 171 | - $console->info($type . " created successfully ... ✅"); |
|
| 171 | + $console->info($type." created successfully ... ✅"); |
|
| 172 | 172 | } else { |
| 173 | - $console->error("Failed to create " . $type . " ..."); |
|
| 173 | + $console->error("Failed to create ".$type." ..."); |
|
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | private function addMyMenu() |
| 58 | 58 | { |
| 59 | - $modelTemplate = file_get_contents(__DIR__ . "/../../Console/Commands/AdminStubs/MyMenu.stub"); |
|
| 59 | + $modelTemplate = file_get_contents(__DIR__."/../../Console/Commands/AdminStubs/MyMenu.stub"); |
|
| 60 | 60 | |
| 61 | 61 | if (!file_exists($path = app_path('Services'))) { |
| 62 | 62 | mkdir($path, 0777, true); |
@@ -73,6 +73,6 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | protected static function getStub($type) |
| 75 | 75 | { |
| 76 | - return file_get_contents(__DIR__ . "/../../Console/Commands/AdminStubs/$type.stub"); |
|
| 76 | + return file_get_contents(__DIR__."/../../Console/Commands/AdminStubs/$type.stub"); |
|
| 77 | 77 | } |
| 78 | 78 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | $this->info("No permission is needed for Super Admin"); |
| 65 | 65 | } else { |
| 66 | 66 | MakePermission::makePermission($name, $role_id, $for_all, $only_flags); |
| 67 | - $this->info("Permission" . $only_flags ? "view and" : "flags made for model " . $name); |
|
| 67 | + $this->info("Permission".$only_flags ? "view and" : "flags made for model ".$name); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | } |