@@ -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 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | protected function getStub() |
| 36 | 36 | { |
| 37 | - return __DIR__ . '/../../Console/Commands/AdminStubs/Trait.stub'; |
|
| 37 | + return __DIR__.'/../../Console/Commands/AdminStubs/Trait.stub'; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -46,6 +46,6 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | protected function getDefaultNamespace($rootNamespace) |
| 48 | 48 | { |
| 49 | - return $rootNamespace . '\Traits'; |
|
| 49 | + return $rootNamespace.'\Traits'; |
|
| 50 | 50 | } |
| 51 | 51 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | protected function getStub() |
| 36 | 36 | { |
| 37 | - return __DIR__ . '/../../Console/Commands/AdminStubs/Service.stub'; |
|
| 37 | + return __DIR__.'/../../Console/Commands/AdminStubs/Service.stub'; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -46,6 +46,6 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | protected function getDefaultNamespace($rootNamespace) |
| 48 | 48 | { |
| 49 | - return $rootNamespace . '\Services'; |
|
| 49 | + return $rootNamespace.'\Services'; |
|
| 50 | 50 | } |
| 51 | 51 | } |
@@ -163,8 +163,8 @@ discard block |
||
| 163 | 163 | $children = [ |
| 164 | 164 | [ |
| 165 | 165 | 'type' => 'submenu', |
| 166 | - 'name' => 'All ' . $plural, |
|
| 167 | - 'is_active' => request()->routeIs($route . '.index') ? 'active' : '', |
|
| 166 | + 'name' => 'All '.$plural, |
|
| 167 | + 'is_active' => request()->routeIs($route.'.index') ? 'active' : '', |
|
| 168 | 168 | 'link' => adminRedirectRoute($route), |
| 169 | 169 | 'conditions' => [ |
| 170 | 170 | [ |
@@ -175,8 +175,8 @@ discard block |
||
| 175 | 175 | ], |
| 176 | 176 | [ |
| 177 | 177 | 'type' => 'submenu', |
| 178 | - 'name' => 'Create ' . $route, |
|
| 179 | - 'is_active' => request()->routeIs($route . '.create') ? 'active' : '', |
|
| 178 | + 'name' => 'Create '.$route, |
|
| 179 | + 'is_active' => request()->routeIs($route.'.create') ? 'active' : '', |
|
| 180 | 180 | 'link' => adminCreateRoute($route), |
| 181 | 181 | 'conditions' => [ |
| 182 | 182 | [ |
@@ -126,26 +126,26 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | private function addAdminServiceProvider() |
| 68 | 68 | { |
| 69 | - $adminServiceProviderTemplate = file_get_contents(__DIR__ . '/../../Console/Commands/AdminStubs/AdminServiceProvider.stub'); |
|
| 69 | + $adminServiceProviderTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/AdminServiceProvider.stub'); |
|
| 70 | 70 | $adminServiceProviderfile = app_path('Providers/AdminServiceProvider.php'); |
| 71 | 71 | file_put_contents($adminServiceProviderfile, $adminServiceProviderTemplate); |
| 72 | 72 | if (file_exists($adminServiceProviderfile)) { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | private function addMyMenu() |
| 80 | 80 | { |
| 81 | - $modelTemplate = file_get_contents(__DIR__ . '/../../Console/Commands/AdminStubs/MyMenu.stub'); |
|
| 81 | + $modelTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/MyMenu.stub'); |
|
| 82 | 82 | |
| 83 | 83 | if (!file_exists($path = app_path('Services'))) { |
| 84 | 84 | mkdir($path, 0777, true); |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | private function addMyDashboard() |
| 97 | 97 | { |
| 98 | - $myDashboardTemplate = file_get_contents(__DIR__ . '/../../Console/Commands/AdminStubs/MyDashboard.stub'); |
|
| 99 | - $myDashboardIndexTemplate = file_get_contents(__DIR__ . '/../../Console/Commands/AdminStubs/DashboardIndex.stub'); |
|
| 98 | + $myDashboardTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/MyDashboard.stub'); |
|
| 99 | + $myDashboardIndexTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/DashboardIndex.stub'); |
|
| 100 | 100 | |
| 101 | 101 | if (!file_exists($path = app_path('Services'))) { |
| 102 | 102 | mkdir($path, 0777, true); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | protected function addHeader() |
| 135 | 135 | { |
| 136 | - $myHeaderTemplate = file_get_contents(__DIR__ . '/../../Console/Commands/AdminStubs/HeaderView.stub'); |
|
| 136 | + $myHeaderTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/HeaderView.stub'); |
|
| 137 | 137 | |
| 138 | 138 | if (!file_exists($path = resource_path('views/admin/layouts/components'))) { |
| 139 | 139 | mkdir($path, 0777, true); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | protected function addFooter() |
| 152 | 152 | { |
| 153 | - $myFooterTemplate = file_get_contents(__DIR__ . '/../../Console/Commands/AdminStubs/FooterView.stub'); |
|
| 153 | + $myFooterTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/FooterView.stub'); |
|
| 154 | 154 | |
| 155 | 155 | if (!file_exists($path = resource_path('views/admin/layouts/components'))) { |
| 156 | 156 | mkdir($path, 0777, true); |
@@ -167,6 +167,6 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | protected static function getStub($type) |
| 169 | 169 | { |
| 170 | - return file_get_contents(__DIR__ . "/../../Console/Commands/AdminStubs/$type.stub"); |
|
| 170 | + return file_get_contents(__DIR__."/../../Console/Commands/AdminStubs/$type.stub"); |
|
| 171 | 171 | } |
| 172 | 172 | } |
@@ -13,10 +13,10 @@ discard block |
||
| 13 | 13 | * @return callable |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | - return function ($options = []) { |
|
| 16 | + return function($options = []) { |
|
| 17 | 17 | $namespace = "Pratiksh\Adminetic\Http\Controllers"; |
| 18 | 18 | |
| 19 | - $this->group(['namespace' => $namespace], function () use ($options) { |
|
| 19 | + $this->group(['namespace' => $namespace], function() use ($options) { |
|
| 20 | 20 | if ($options['home'] ?? true) { |
| 21 | 21 | $this->view('/', 'adminetic::welcome'); |
| 22 | 22 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function resetPassword() |
| 87 | 87 | { |
| 88 | - return function () { |
|
| 88 | + return function() { |
|
| 89 | 89 | $this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request'); |
| 90 | 90 | $this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email'); |
| 91 | 91 | $this->get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset'); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function confirmPassword() |
| 102 | 102 | { |
| 103 | - return function () { |
|
| 103 | + return function() { |
|
| 104 | 104 | $this->get('password/confirm', 'Auth\ConfirmPasswordController@showConfirmForm')->name('password.confirm'); |
| 105 | 105 | $this->post('password/confirm', 'Auth\ConfirmPasswordController@confirm'); |
| 106 | 106 | }; |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function emailVerification() |
| 115 | 115 | { |
| 116 | - return function () { |
|
| 116 | + return function() { |
|
| 117 | 117 | $this->get('email/verify', 'Auth\VerificationController@show')->name('verification.notice'); |
| 118 | 118 | $this->get('email/verify/{id}/{hash}', 'Auth\VerificationController@verify')->name('verification.verify'); |
| 119 | 119 | $this->post('email/resend', 'Auth\VerificationController@resend')->name('verification.resend'); |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @param string $route |
| 7 | 7 | *@return string |
| 8 | 8 | */ |
| 9 | -if (! function_exists('adminBaseUrl')) { |
|
| 9 | +if (!function_exists('adminBaseUrl')) { |
|
| 10 | 10 | function adminBaseUrl($route) |
| 11 | 11 | { |
| 12 | 12 | return url(config('admin.prefix', 'admin').'/'.$route); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | *@param string $route |
| 20 | 20 | *@return string |
| 21 | 21 | */ |
| 22 | -if (! function_exists('adminRedirectRoute')) { |
|
| 22 | +if (!function_exists('adminRedirectRoute')) { |
|
| 23 | 23 | function adminRedirectRoute($route) |
| 24 | 24 | { |
| 25 | 25 | return adminBaseUrl($route); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | *@param string $route |
| 33 | 33 | *@return string |
| 34 | 34 | */ |
| 35 | -if (! function_exists('adminCreateRoute')) { |
|
| 35 | +if (!function_exists('adminCreateRoute')) { |
|
| 36 | 36 | function adminCreateRoute($route) |
| 37 | 37 | { |
| 38 | 38 | return adminBaseUrl($route).'/create'; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | *@param int $id |
| 47 | 47 | *@return return_type |
| 48 | 48 | */ |
| 49 | -if (! function_exists('adminShowRoute')) { |
|
| 49 | +if (!function_exists('adminShowRoute')) { |
|
| 50 | 50 | function adminShowRoute($route, $id) |
| 51 | 51 | { |
| 52 | 52 | return adminBaseUrl($route).'/'.$id; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | *@param int $id |
| 61 | 61 | *@return string |
| 62 | 62 | */ |
| 63 | -if (! function_exists('adminEditRoute')) { |
|
| 63 | +if (!function_exists('adminEditRoute')) { |
|
| 64 | 64 | function adminEditRoute($route, $id) |
| 65 | 65 | { |
| 66 | 66 | return adminBaseUrl($route).'/'.$id.'/edit'; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | *@param string $route |
| 74 | 74 | *@return string |
| 75 | 75 | */ |
| 76 | -if (! function_exists('adminStoreRoute')) { |
|
| 76 | +if (!function_exists('adminStoreRoute')) { |
|
| 77 | 77 | function adminStoreRoute($route) |
| 78 | 78 | { |
| 79 | 79 | return adminBaseUrl($route); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | *@param int $id |
| 88 | 88 | *@return string |
| 89 | 89 | */ |
| 90 | -if (! function_exists('adminUpdateRoute')) { |
|
| 90 | +if (!function_exists('adminUpdateRoute')) { |
|
| 91 | 91 | function adminUpdateRoute($route, $id) |
| 92 | 92 | { |
| 93 | 93 | return adminBaseUrl($route).'/'.$id; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | *@param int $id |
| 102 | 102 | *@return string |
| 103 | 103 | */ |
| 104 | -if (! function_exists('adminDeleteRoute')) { |
|
| 104 | +if (!function_exists('adminDeleteRoute')) { |
|
| 105 | 105 | function adminDeleteRoute($route, $id) |
| 106 | 106 | { |
| 107 | 107 | return adminBaseUrl($route).'/'.$id; |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | public function indexSetting() |
| 16 | 16 | { |
| 17 | 17 | $settings = config('adminetic.caching', true) |
| 18 | - ? (Cache::has('settings') ? Cache::get('settings') : Cache::rememberForever('settings', function () { |
|
| 18 | + ? (Cache::has('settings') ? Cache::get('settings') : Cache::rememberForever('settings', function() { |
|
| 19 | 19 | return Setting::latest()->get(); |
| 20 | 20 | })) |
| 21 | 21 | : Setting::latest()->get(); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | 'string_value' => $value->store('admin/setting', 'public'), |
| 120 | 120 | ]); |
| 121 | 121 | $image = Image::make($value->getRealPath()); |
| 122 | - $image->save(public_path('storage/' . $setting->string_value)); |
|
| 122 | + $image->save(public_path('storage/'.$setting->string_value)); |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | } elseif ($setting->getRawOriginal('setting_type') == 2 || $setting->getRawOriginal('setting_type') == 6 || $setting->getRawOriginal('setting_type') == 7) { |