@@ -18,16 +18,16 @@ |
||
| 18 | 18 | { |
| 19 | 19 | $adminPath = cbConfig('ADMIN_PATH', 'admin'); |
| 20 | 20 | |
| 21 | - if(!auth('cbAdmin')->id()){ |
|
| 21 | + if (!auth('cbAdmin')->id()) { |
|
| 22 | 22 | $url = url($adminPath.'/login'); |
| 23 | 23 | return redirect($url)->with('message', cbTrans('not_logged_in')); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - if(!CRUDBooster::isSuperadmin()) { |
|
| 27 | - return redirect($adminPath)->with(['message'=> cbTrans('denied_access'),'message_type'=>'warning']); |
|
| 26 | + if (!CRUDBooster::isSuperadmin()) { |
|
| 27 | + return redirect($adminPath)->with(['message'=> cbTrans('denied_access'), 'message_type'=>'warning']); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - if(CRUDBooster::isLocked()){ |
|
| 30 | + if (CRUDBooster::isLocked()) { |
|
| 31 | 31 | return redirect(url($adminPath.'/lock-screen')); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function getLockscreen() |
| 41 | 41 | { |
| 42 | - if (! auth('cbAdmin')->id()) { |
|
| 42 | + if (!auth('cbAdmin')->id()) { |
|
| 43 | 43 | Session::flush(); |
| 44 | 44 | return redirect()->route('getLogin')->with('message', cbTrans('alert_session_expired')); |
| 45 | 45 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | private function validateForgotPass() |
| 107 | 107 | { |
| 108 | - $validator = Validator::make(request()->all(), ['email' => 'required|email|exists:cms_users',]); |
|
| 108 | + $validator = Validator::make(request()->all(), ['email' => 'required|email|exists:cms_users', ]); |
|
| 109 | 109 | |
| 110 | 110 | if ($validator->fails()) { |
| 111 | 111 | $message = $validator->errors()->all(); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | $user = $this->usersRepo->findByMail(request("email")); |
| 33 | 33 | |
| 34 | - if (! auth('cbAdmin')->attempt($cred)) { |
|
| 34 | + if (!auth('cbAdmin')->attempt($cred)) { |
|
| 35 | 35 | $resp = redirect()->route('getLogin')->with('message', cbTrans('alert_password_wrong')); |
| 36 | 36 | sendAndTerminate($resp); |
| 37 | 37 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | { |
| 10 | 10 | public static function sidebarMenu() |
| 11 | 11 | { |
| 12 | - $conditions = [ |
|
| 12 | + $conditions = [ |
|
| 13 | 13 | 'cms_privileges' => auth('cbAdmin')->user()->id_cms_privileges, |
| 14 | 14 | 'parent_id' => 0, |
| 15 | 15 | 'is_active' => 1, |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | public static function myPrivilege() |
| 79 | 79 | { |
| 80 | 80 | $roles = session('admin_privileges_roles'); |
| 81 | - if (! $roles) { |
|
| 81 | + if (!$roles) { |
|
| 82 | 82 | return; |
| 83 | 83 | } |
| 84 | 84 | foreach ($roles as $role) { |
@@ -55,17 +55,17 @@ discard block |
||
| 55 | 55 | __DIR__.'/userfiles/views/vendor/crudbooster/type_components/readme.txt' => resource_path('views/vendor/crudbooster/type_components/readme.txt'), |
| 56 | 56 | ], 'cb_type_components'); |
| 57 | 57 | |
| 58 | - if (! file_exists(app_path('Http/Controllers/CBHook.php'))) { |
|
| 58 | + if (!file_exists(app_path('Http/Controllers/CBHook.php'))) { |
|
| 59 | 59 | $this->publishes([__DIR__.'/userfiles/controllers/CBHook.php' => app_path('Http/Controllers/CBHook.php')], 'CBHook'); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if (! file_exists(app_path('Http/Controllers/AdminUsersController.php'))) { |
|
| 62 | + if (!file_exists(app_path('Http/Controllers/AdminUsersController.php'))) { |
|
| 63 | 63 | $this->publishes([__DIR__.'/userfiles/controllers/AdminUsersController.php' => app_path('Http/Controllers/AdminUsersController.php')], 'cb_user_controller'); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | $this->defineValidationRules(); |
| 68 | - $this->loadRoutesFrom( __DIR__.'/routes.php'); |
|
| 68 | + $this->loadRoutesFrom(__DIR__.'/routes.php'); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | $this->mergeConfigFrom(__DIR__.'/configs/crudbooster.php', 'crudbooster'); |
| 79 | 79 | |
| 80 | - $this->app->singleton('crudbooster', function () { |
|
| 80 | + $this->app->singleton('crudbooster', function() { |
|
| 81 | 81 | return true; |
| 82 | 82 | }); |
| 83 | 83 | |
@@ -123,14 +123,14 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | private function registerCrudboosterCommand() |
| 125 | 125 | { |
| 126 | - $this->app->singleton('crudboosterinstall', function () { |
|
| 126 | + $this->app->singleton('crudboosterinstall', function() { |
|
| 127 | 127 | return new CrudboosterInstallationCommand; |
| 128 | 128 | }); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | private function defineValidationRules() |
| 132 | 132 | { |
| 133 | - \Validator::extend('alpha_spaces', function ($attribute, $value) { |
|
| 133 | + \Validator::extend('alpha_spaces', function($attribute, $value) { |
|
| 134 | 134 | // This will only accept alpha and spaces. |
| 135 | 135 | // If you want to accept hyphens use: /^[\pL\s-]+$/u. |
| 136 | 136 | return preg_match('/^[\pL\s]+$/u', $value); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | private function defineAuthGuard() |
| 141 | 141 | { |
| 142 | - config()->offsetSet('auth.providers.cb_users', ['driver' => 'eloquent', 'model' => CbUser::class,]); |
|
| 142 | + config()->offsetSet('auth.providers.cb_users', ['driver' => 'eloquent', 'model' => CbUser::class, ]); |
|
| 143 | 143 | config()->offsetSet('auth.guards.cbAdmin', ['driver' => 'session', 'provider' => 'cb_users']); |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | |
| 40 | 40 | public function myPhoto() : string |
| 41 | 41 | { |
| 42 | - $photo = $this->photo ?: 'vendor/crudbooster/avatar.jpg'; |
|
| 42 | + $photo = $this->photo ?: 'vendor/crudbooster/avatar.jpg'; |
|
| 43 | 43 | return asset($photo); |
| 44 | 44 | } |
| 45 | 45 | |