Completed
Pull Request — dev (#235)
by Alies
07:13
created
app/Models/Auth/Traits/Attribute/UserAttribute.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         /*
111 111
          * If the admin is currently NOT spoofing a user
112 112
          */
113
-        if (! session()->has('admin_user_id') || ! session()->has('temp_user_id')) {
113
+        if (!session()->has('admin_user_id') || !session()->has('temp_user_id')) {
114 114
             //Won't break, but don't let them "Login As" themselves
115 115
             if ($this->id != auth()->id()) {
116 116
                 return '<a href="'.route(
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
      */
196 196
     public function getConfirmedButtonAttribute()
197 197
     {
198
-        if (! $this->isConfirmed() && ! config('access.users.requires_approval')) {
198
+        if (!$this->isConfirmed() && !config('access.users.requires_approval')) {
199 199
             return '<a href="'.route('admin.auth.user.account.confirm.resend', $this).'" class="dropdown-item">'.__('buttons.backend.access.users.resend_email').'</a> ';
200 200
         }
201 201
 
Please login to merge, or discard this patch.
app/Models/User.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -112,19 +112,19 @@  discard block
 block discarded – undo
112 112
     {
113 113
         parent::boot();
114 114
 
115
-        static::saving(function (self $model) {
115
+        static::saving(function(self $model) {
116 116
             $model->slug = str_slug($model->name);
117 117
         });
118 118
     }
119 119
 
120 120
     public function getCanEditAttribute()
121 121
     {
122
-        return ! $this->is_super_admin || 1 === auth()->id();
122
+        return !$this->is_super_admin || 1 === auth()->id();
123 123
     }
124 124
 
125 125
     public function getCanDeleteAttribute()
126 126
     {
127
-        return ! $this->is_super_admin && $this->id !== auth()->id() && (
127
+        return !$this->is_super_admin && $this->id !== auth()->id() && (
128 128
             Gate::check('delete users')
129 129
         );
130 130
     }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     public function getCanImpersonateAttribute()
133 133
     {
134 134
         if (Gate::check('impersonate users')) {
135
-            return ! $this->is_super_admin
135
+            return !$this->is_super_admin
136 136
                 && session()->get('admin_user_id') !== $this->id
137 137
                 && $this->id !== auth()->id();
138 138
         }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      */
168 168
     public function getProvider($provider)
169 169
     {
170
-        return $this->providers->first(function (SocialLogin $item) use ($provider) {
170
+        return $this->providers->first(function(SocialLogin $item) use ($provider) {
171 171
             return $item->provider === $provider;
172 172
         });
173 173
     }
Please login to merge, or discard this patch.
app/Repositories/EloquentUserRepository.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             $user->timezone = $this->config->get('app.timezone');
97 97
         }
98 98
 
99
-        if (! $this->save($user, $input)) {
99
+        if (!$this->save($user, $input)) {
100 100
             throw new GeneralException(__('exceptions.backend.users.create'));
101 101
         }
102 102
 
@@ -116,17 +116,17 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function update(User $user, array $input)
118 118
     {
119
-        if (! $user->can_edit) {
119
+        if (!$user->can_edit) {
120 120
             throw new GeneralException(__('exceptions.backend.users.first_user_cannot_be_edited'));
121 121
         }
122 122
 
123 123
         $user->fill(Arr::except($input, 'password'));
124 124
 
125
-        if ($user->is_super_admin && ! $user->active) {
125
+        if ($user->is_super_admin && !$user->active) {
126 126
             throw new GeneralException(__('exceptions.backend.users.first_user_cannot_be_disabled'));
127 127
         }
128 128
 
129
-        if (! $this->save($user, $input)) {
129
+        if (!$this->save($user, $input)) {
130 130
             throw new GeneralException(__('exceptions.backend.users.update'));
131 131
         }
132 132
 
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
      */
146 146
     private function save(User $user, array $input)
147 147
     {
148
-        if (isset($input['password']) && ! empty($input['password'])) {
148
+        if (isset($input['password']) && !empty($input['password'])) {
149 149
             $user->password = Hash::make($input['password']);
150 150
         }
151 151
 
152
-        if (! $user->save()) {
152
+        if (!$user->save()) {
153 153
             return false;
154 154
         }
155 155
 
@@ -165,11 +165,11 @@  discard block
 block discarded – undo
165 165
      */
166 166
     public function destroy(User $user)
167 167
     {
168
-        if (! $user->can_delete) {
168
+        if (!$user->can_delete) {
169 169
             throw new GeneralException(__('exceptions.backend.users.first_user_cannot_be_destroyed'));
170 170
         }
171 171
 
172
-        if (! $user->delete()) {
172
+        if (!$user->delete()) {
173 173
             throw new GeneralException(__('exceptions.backend.users.delete'));
174 174
         }
175 175
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
             return redirect()->route('admin.home');
200 200
         }
201 201
 
202
-        if (! session()->get('admin_user_id')) {
202
+        if (!session()->get('admin_user_id')) {
203 203
             session(['admin_user_id' => $authenticatedUser->id]);
204 204
             session(['admin_user_name' => $authenticatedUser->name]);
205 205
             session(['temp_user_id' => $user->id]);
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
      */
221 221
     public function batchDestroy(array $ids)
222 222
     {
223
-        DB::transaction(function () use ($ids) {
223
+        DB::transaction(function() use ($ids) {
224 224
             // This wont call eloquent events, change to destroy if needed
225 225
             if ($this->query()->whereIn('id', $ids)->delete()) {
226 226
                 return true;
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      */
242 242
     public function batchEnable(array $ids)
243 243
     {
244
-        DB::transaction(function () use ($ids) {
244
+        DB::transaction(function() use ($ids) {
245 245
             if ($this->query()->whereIn('id', $ids)
246 246
                 ->update(['active' => true])
247 247
             ) {
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
      */
264 264
     public function batchDisable(array $ids)
265 265
     {
266
-        DB::transaction(function () use ($ids) {
266
+        DB::transaction(function() use ($ids) {
267 267
             if ($this->query()->whereIn('id', $ids)
268 268
                 ->update(['active' => false])
269 269
             ) {
Please login to merge, or discard this patch.
app/Repositories/Backend/Auth/UserRepository.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function create(array $data) : User
101 101
     {
102
-        return DB::transaction(function () use ($data) {
102
+        return DB::transaction(function() use ($data) {
103 103
             $user = parent::create([
104 104
                 'first_name' => $data['first_name'],
105 105
                 'last_name' => $data['last_name'],
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
             if ($user) {
114 114
                 //Send confirmation email if requested and account approval is off
115
-                if (isset($data['confirmation_email']) && $user->confirmed == 0 && ! config('access.users.requires_approval')) {
115
+                if (isset($data['confirmation_email']) && $user->confirmed == 0 && !config('access.users.requires_approval')) {
116 116
                     $user->notify(new UserNeedsConfirmation($user->confirmation_code));
117 117
                 }
118 118
 
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
         $this->checkUserByEmail($user, $data['email']);
140 140
 
141 141
         // See if adding any additional permissions
142
-        if (! isset($data['permissions']) || ! count($data['permissions'])) {
142
+        if (!isset($data['permissions']) || !count($data['permissions'])) {
143 143
             $data['permissions'] = [];
144 144
         }
145 145
 
146
-        return DB::transaction(function () use ($user, $data) {
146
+        return DB::transaction(function() use ($user, $data) {
147 147
             if ($user->update([
148 148
                 'first_name' => $data['first_name'],
149 149
                 'last_name' => $data['last_name'],
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
      */
246 246
     public function unconfirm(User $user) : User
247 247
     {
248
-        if (! $user->confirmed) {
248
+        if (!$user->confirmed) {
249 249
             throw new GeneralException(__('exceptions.backend.access.users.not_confirmed'));
250 250
         }
251 251
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             throw new GeneralException(__('exceptions.backend.access.users.delete_first'));
286 286
         }
287 287
 
288
-        return DB::transaction(function () use ($user) {
288
+        return DB::transaction(function() use ($user) {
289 289
             // Delete associated relationships
290 290
             $user->passwordHistories()->delete();
291 291
             $user->providers()->delete();
Please login to merge, or discard this patch.
app/Models/Traits/Uuid.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     {
34 34
         parent::boot();
35 35
 
36
-        static::creating(function ($model) {
36
+        static::creating(function($model) {
37 37
             $model->{$model->getUuidName()} = Str::uuid();
38 38
         });
39 39
     }
Please login to merge, or discard this patch.