Completed
Push — master ( 3a8db8...5050df )
by Sherif
01:59
created
src/Modules/OauthClients/Providers/RouteServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         Route::role([
55 55
             'middleware' => 'web',
56 56
             'namespace'  => $this->namespace,
57
-        ], function ($router) {
57
+        ], function($router) {
58 58
             require module_path('oauth-clients', 'Routes/web.php', 'app');
59 59
         });
60 60
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             'middleware' => 'api',
73 73
             'namespace'  => $this->namespace,
74 74
             'prefix'     => 'api',
75
-        ], function ($router) {
75
+        ], function($router) {
76 76
             require module_path('oauth-clients', 'Routes/api.php', 'app');
77 77
         });
78 78
     }
Please login to merge, or discard this patch.
src/Modules/OauthClients/Routes/api.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-Route::role(['prefix' => 'oauth/clients'], function () {
14
+Route::role(['prefix' => 'oauth/clients'], function() {
15 15
         
16 16
     Route::get('/', 'OauthClientController@index');
17 17
     Route::get('/{id}', 'OauthClientController@find');
Please login to merge, or discard this patch.
src/Modules/Users/Database/Seeds/AssignRelationsSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         /**
19 19
          * Assign the permissions to the admin role.
20 20
          */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['user'])->each(function ($permission) use ($adminRoleId) {
21
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['user'])->each(function($permission) use ($adminRoleId) {
22 22
             \DB::table('roles_permissions')->insert(
23 23
                 [
24 24
                 'permission_id' => $permission->id,
Please login to merge, or discard this patch.
src/Modules/Users/Providers/RouteServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         Route::role([
55 55
             'middleware' => 'web',
56 56
             'namespace'  => $this->namespace,
57
-        ], function ($router) {
57
+        ], function($router) {
58 58
             require module_path('users', 'Routes/web.php', 'app');
59 59
         });
60 60
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             'middleware' => 'api',
73 73
             'namespace'  => $this->namespace,
74 74
             'prefix'     => 'api',
75
-        ], function ($router) {
75
+        ], function($router) {
76 76
             require module_path('users', 'Routes/api.php', 'app');
77 77
         });
78 78
     }
Please login to merge, or discard this patch.
src/Modules/Users/Routes/api.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 |
14 14
 */
15 15
 
16
-Route::role(['prefix' => 'users'], function () {
16
+Route::role(['prefix' => 'users'], function() {
17 17
 
18 18
     Route::get('/', 'UserController@index');
19 19
     Route::get('/{id}', 'UserController@find');
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     Route::post('assign/roles', 'UserController@assignRoles');
28 28
     Route::post('role/{roleName}', 'UserController@role');
29 29
 
30
-    Route::role(['prefix' => 'account'], function () {
30
+    Route::role(['prefix' => 'account'], function() {
31 31
 
32 32
         Route::get('my', 'UserController@account');
33 33
         Route::get('logout', 'UserController@logout');
Please login to merge, or discard this patch.
src/Modules/Users/Reppsitories/UserRepository.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $permissions = [];
29 29
         $user        = $this->find(\Auth::id(), $relations);
30 30
         foreach ($user->roles()->get() as $role) {
31
-            $role->permissions->each(function ($permission) use (&$permissions) {
31
+            $role->permissions->each(function($permission) use (&$permissions) {
32 32
                 $permissions[$permission->model][$permission->id] = $permission->name;
33 33
             });
34 34
         }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         $user        = $user ?: $this->find(\Auth::id(), ['roles.permissions']);
52 52
         $permissions = [];
53 53
 
54
-        $user->roles->pluck('permissions')->each(function ($permission) use (&$permissions, $model) {
54
+        $user->roles->pluck('permissions')->each(function($permission) use (&$permissions, $model) {
55 55
             $permissions = array_merge($permissions, $permission->where('model', $model)->pluck('name')->toArray());
56 56
         });
57 57
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function assignRoles($userId, $roleIds)
82 82
     {
83
-        \DB::transaction(function () use ($userId, $roleIds) {
83
+        \DB::transaction(function() use ($userId, $roleIds) {
84 84
             $user = $this->find($userId);
85 85
             $user->roles()->detach();
86 86
             $user->roles()->attach($roleIds);
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function login($credentials, $adminLogin = false)
101 101
     {
102
-        if (! $user = $this->first(['email' => $credentials['email']])) {
102
+        if ( ! $user = $this->first(['email' => $credentials['email']])) {
103 103
             \ErrorHandler::loginFailed();
104 104
         } elseif ($adminLogin && ! $user->roles->whereIn('name', ['Admin'])->count()) {
105 105
             \ErrorHandler::loginFailed();
106
-        } elseif (! $adminLogin && $user->roles->whereIn('name', ['Admin'])->count()) {
106
+        } elseif ( ! $adminLogin && $user->roles->whereIn('name', ['Admin'])->count()) {
107 107
             \ErrorHandler::loginFailed();
108 108
         } elseif ($user->blocked) {
109 109
             \ErrorHandler::userIsBlocked();
110
-        } elseif (! config('skeleton.disable_confirm_email') && ! $user->confirmed) {
110
+        } elseif ( ! config('skeleton.disable_confirm_email') && ! $user->confirmed) {
111 111
             \ErrorHandler::emailNotConfirmed();
112 112
         }
113 113
 
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
         $access_token = $authCode ? Arr::get(\Socialite::driver($type)->getAccessTokenResponse($authCode), 'access_token') : $accessToken;
128 128
         $user         = \Socialite::driver($type)->userFromToken($access_token);
129 129
 
130
-        if (! $user->email) {
130
+        if ( ! $user->email) {
131 131
             \ErrorHandler::noSocialEmail();
132 132
         }
133 133
 
134
-        if (! $this->model->where('email', $user->email)->first()) {
134
+        if ( ! $this->model->where('email', $user->email)->first()) {
135 135
             $this->register(['email' => $user->email, 'password' => ''], true);
136 136
         }
137 137
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         if ($skipConfirmEmail) {
154 154
             $user->confirmed = 1;
155 155
             $user->save();
156
-        } elseif (! config('skeleton.disable_confirm_email')) {
156
+        } elseif ( ! config('skeleton.disable_confirm_email')) {
157 157
             $this->sendConfirmationEmail($user->email);
158 158
         }
159 159
 
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
      */
169 169
     public function block($userId)
170 170
     {
171
-        if (! $user = $this->find($userId)) {
171
+        if ( ! $user = $this->find($userId)) {
172 172
             \ErrorHandler::notFound('user');
173 173
         }
174
-        if (! $this->hasRole(['Admin'])) {
174
+        if ( ! $this->hasRole(['Admin'])) {
175 175
             \ErrorHandler::noPermissions();
176 176
         } elseif (\Auth::id() == $userId) {
177 177
             \ErrorHandler::noPermissions();
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      */
194 194
     public function unblock($userId)
195 195
     {
196
-        if (! $this->hasRole(['Admin'])) {
196
+        if ( ! $this->hasRole(['Admin'])) {
197 197
             \ErrorHandler::noPermissions();
198 198
         }
199 199
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      */
213 213
     public function sendReset($email)
214 214
     {
215
-        if (! $user = $this->model->where('email', $email)->first()) {
215
+        if ( ! $user = $this->model->where('email', $email)->first()) {
216 216
             \ErrorHandler::notFound('email');
217 217
         }
218 218
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      */
229 229
     public function resetPassword($credentials)
230 230
     {
231
-        $response = \Password::reset($credentials, function ($user, $password) {
231
+        $response = \Password::reset($credentials, function($user, $password) {
232 232
             $user->password = $password;
233 233
             $user->save();
234 234
         });
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
     public function changePassword($credentials)
264 264
     {
265 265
         $user = \Auth::user();
266
-        if (! \Hash::check($credentials['old_password'], $user->password)) {
266
+        if ( ! \Hash::check($credentials['old_password'], $user->password)) {
267 267
             \ErrorHandler::invalidOldPassword();
268 268
         }
269 269
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
      */
280 280
     public function confirmEmail($confirmationCode)
281 281
     {
282
-        if (! $user = $this->first(['confirmation_code' => $confirmationCode])) {
282
+        if ( ! $user = $this->first(['confirmation_code' => $confirmationCode])) {
283 283
             \ErrorHandler::invalidConfirmationCode();
284 284
         }
285 285
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         $sort       = $desc ? 'desc' : 'asc';
325 325
         $model      = $this->model->with($relations);
326 326
 
327
-        $model->whereHas('roles', function ($q) use ($roleName) {
327
+        $model->whereHas('roles', function($q) use ($roleName) {
328 328
             $q->where('name', $roleName);
329 329
         });
330 330
 
Please login to merge, or discard this patch.
Modules/PushNotificationDevices/Database/Seeds/AssignRelationsSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         /**
19 19
          * Assign the permissions to the admin role.
20 20
          */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['pushNotificationDevice'])->each(function ($permission) use ($adminRoleId) {
21
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['pushNotificationDevice'])->each(function($permission) use ($adminRoleId) {
22 22
             \DB::table('roles_permissions')->insert(
23 23
                 [
24 24
                 'permission_id' => $permission->id,
Please login to merge, or discard this patch.
src/Modules/PushNotificationDevices/Providers/RouteServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         Route::role([
55 55
             'middleware' => 'web',
56 56
             'namespace'  => $this->namespace,
57
-        ], function ($router) {
57
+        ], function($router) {
58 58
             require module_path('push-notification-devices', 'Routes/web.php', 'app');
59 59
         });
60 60
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             'middleware' => 'api',
73 73
             'namespace'  => $this->namespace,
74 74
             'prefix'     => 'api',
75
-        ], function ($router) {
75
+        ], function($router) {
76 76
             require module_path('push-notification-devices', 'Routes/api.php', 'app');
77 77
         });
78 78
     }
Please login to merge, or discard this patch.
src/Modules/PushNotificationDevices/Routes/api.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 |
14 14
 */
15 15
 
16
-Route::role(['prefix' => 'push/notification/devices'], function () {
16
+Route::role(['prefix' => 'push/notification/devices'], function() {
17 17
         
18 18
     Route::get('/', 'PushNotificationDeviceController@index');
19 19
     Route::get('/{id}', 'PushNotificationDeviceController@find');
Please login to merge, or discard this patch.