@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('jobs', function (Blueprint $table) { |
|
16 | + Schema::create('jobs', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->string('queue'); |
19 | 19 | $table->longText('payload'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('failed_jobs', function (Blueprint $table) { |
|
16 | + Schema::create('failed_jobs', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->text('connection'); |
19 | 19 | $table->text('queue'); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $permissions = []; |
68 | 68 | $user = $this->repo->find(\Auth::id(), $relations); |
69 | 69 | foreach ($user->roles as $role) { |
70 | - $role->permissions->each(function ($permission) use (&$permissions) { |
|
70 | + $role->permissions->each(function($permission) use (&$permissions) { |
|
71 | 71 | $permissions[$permission->repo][$permission->id] = $permission->name; |
72 | 72 | }); |
73 | 73 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | public function assignRoles($userId, $roleIds) |
131 | 131 | { |
132 | 132 | $user = false; |
133 | - \DB::transaction(function () use ($userId, $roleIds, &$user) { |
|
133 | + \DB::transaction(function() use ($userId, $roleIds, &$user) { |
|
134 | 134 | $user = $this->repo->find($userId); |
135 | 135 | $this->repo->detachRoles($user); |
136 | 136 | $this->repo->attachRoles($user, $roleIds); |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function login($email, $password) |
150 | 150 | { |
151 | - if (! $user = $this->repo->first(['email' => $email])) { |
|
151 | + if ( ! $user = $this->repo->first(['email' => $email])) { |
|
152 | 152 | \Errors::loginFailed(); |
153 | 153 | } elseif ($user->blocked) { |
154 | 154 | \Errors::userIsBlocked(); |
155 | - } elseif (! config('user.disable_confirm_email') && ! $user->confirmed) { |
|
155 | + } elseif ( ! config('user.disable_confirm_email') && ! $user->confirmed) { |
|
156 | 156 | \Errors::emailNotConfirmed(); |
157 | 157 | } |
158 | 158 | |
@@ -171,11 +171,11 @@ discard block |
||
171 | 171 | $accessToken = $authCode ? Arr::get(\Socialite::driver($type)->getAccessTokenResponse($authCode), 'access_token') : $accessToken; |
172 | 172 | $user = \Socialite::driver($type)->userFromToken($accessToken)->user; |
173 | 173 | |
174 | - if (! \Arr::has($user, 'email')) { |
|
174 | + if ( ! \Arr::has($user, 'email')) { |
|
175 | 175 | \Errors::noSocialEmail(); |
176 | 176 | } |
177 | 177 | |
178 | - if (! $this->repo->first(['email' => $user['email']])) { |
|
178 | + if ( ! $this->repo->first(['email' => $user['email']])) { |
|
179 | 179 | $this->register($user['name'], $user['email'], '', true); |
180 | 180 | } |
181 | 181 | |
@@ -193,13 +193,13 @@ discard block |
||
193 | 193 | { |
194 | 194 | $data['confirmed'] = $skipConfirmEmail; |
195 | 195 | |
196 | - if($roleId){ |
|
196 | + if ($roleId) { |
|
197 | 197 | $data ['roles'] = [['id' => $roleId]]; |
198 | 198 | } |
199 | 199 | |
200 | 200 | $user = $this->repo->save($data); |
201 | 201 | |
202 | - if (! $skipConfirmEmail && ! config('user.disable_confirm_email')) { |
|
202 | + if ( ! $skipConfirmEmail && ! config('user.disable_confirm_email')) { |
|
203 | 203 | $this->sendConfirmationEmail($user->email); |
204 | 204 | } |
205 | 205 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function sendReset($email) |
242 | 242 | { |
243 | - if (! $user = $this->repo->first(['email' => $email])) { |
|
243 | + if ( ! $user = $this->repo->first(['email' => $email])) { |
|
244 | 244 | \Errors::notFound('email'); |
245 | 245 | } |
246 | 246 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | 'password' => $password, |
265 | 265 | 'password_confirmation' => $passwordConfirmation, |
266 | 266 | 'token' => $token |
267 | - ], function ($user, $password) { |
|
267 | + ], function($user, $password) { |
|
268 | 268 | $this->repo->save(['id' => $user->id, 'password' => $password]); |
269 | 269 | }); |
270 | 270 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | public function changePassword($password, $oldPassword) |
298 | 298 | { |
299 | 299 | $user = \Auth::user(); |
300 | - if (! \Hash::check($oldPassword, $user->password)) { |
|
300 | + if ( ! \Hash::check($oldPassword, $user->password)) { |
|
301 | 301 | \Errors::invalidOldPassword(); |
302 | 302 | } |
303 | 303 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | */ |
313 | 313 | public function confirmEmail($confirmationCode) |
314 | 314 | { |
315 | - if (! $user = $this->repo->first(['confirmation_code' => $confirmationCode])) { |
|
315 | + if ( ! $user = $this->repo->first(['confirmation_code' => $confirmationCode])) { |
|
316 | 316 | \Errors::invalidConfirmationCode(); |
317 | 317 | } |
318 | 318 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | Role::updateOrInsert([ |
22 | 22 | 'name' => RoleEnum::ADMIN, |
23 | - ],[ |
|
23 | + ], [ |
|
24 | 24 | 'created_at' => \DB::raw('NOW()'), |
25 | 25 | 'updated_at' => \DB::raw('NOW()') |
26 | 26 | ]); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | AclUser::updateOrInsert([ |
32 | 32 | 'email' => '[email protected]', |
33 | - ],[ |
|
33 | + ], [ |
|
34 | 34 | 'name' => 'Admin', |
35 | 35 | 'password' => \Hash::make('123456'), |
36 | 36 | 'confirmed' => 1, |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * Assign default users to admin roles. |
43 | 43 | */ |
44 | - $adminRoleId = Role::where('name', RoleEnum::ADMIN)->select('id')->first()->id;; |
|
44 | + $adminRoleId = Role::where('name', RoleEnum::ADMIN)->select('id')->first()->id; ; |
|
45 | 45 | $adminUserId = AclUser::where('email', '[email protected]')->select('id')->first()->id; |
46 | 46 | \DB::table('role_user')->updateOrInsert([ |
47 | 47 | 'user_id' => $adminUserId, |
48 | 48 | 'role_id' => $adminRoleId, |
49 | - ],[]); |
|
49 | + ], []); |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Insert the permissions related to roles table. |