@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function up() |
42 | 42 | { |
43 | - $this->schema->create('telescope_entries', function (Blueprint $table) { |
|
43 | + $this->schema->create('telescope_entries', function(Blueprint $table) { |
|
44 | 44 | $table->bigIncrements('sequence'); |
45 | 45 | $table->uuid('uuid'); |
46 | 46 | $table->uuid('batch_id'); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $table->index(['type', 'should_display_on_index']); |
56 | 56 | }); |
57 | 57 | |
58 | - $this->schema->create('telescope_entries_tags', function (Blueprint $table) { |
|
58 | + $this->schema->create('telescope_entries_tags', function(Blueprint $table) { |
|
59 | 59 | $table->uuid('entry_uuid'); |
60 | 60 | $table->string('tag'); |
61 | 61 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | ->onDelete('cascade'); |
69 | 69 | }); |
70 | 70 | |
71 | - $this->schema->create('telescope_monitoring', function (Blueprint $table) { |
|
71 | + $this->schema->create('telescope_monitoring', function(Blueprint $table) { |
|
72 | 72 | $table->string('tag'); |
73 | 73 | }); |
74 | 74 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function __construct($model) |
23 | 23 | { |
24 | - $this->model = $model; |
|
24 | + $this->model = $model; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $model = false; |
87 | 87 | $relations = []; |
88 | 88 | |
89 | - \DB::transaction(function () use (&$model, &$relations, $data) { |
|
89 | + \DB::transaction(function() use (&$model, &$relations, $data) { |
|
90 | 90 | |
91 | 91 | $model = $this->prepareModel($data); |
92 | 92 | $relations = $this->prepareRelations($data, $model); |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function delete($value, $attribute = 'id') |
112 | 112 | { |
113 | - \DB::transaction(function () use ($value, $attribute) { |
|
114 | - $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function ($model) { |
|
113 | + \DB::transaction(function() use ($value, $attribute) { |
|
114 | + $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function($model) { |
|
115 | 115 | $model->delete(); |
116 | 116 | }); |
117 | 117 | }); |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | { |
202 | 202 | $model = $this->model->onlyTrashed()->find($id); |
203 | 203 | |
204 | - if (! $model) { |
|
204 | + if ( ! $model) { |
|
205 | 205 | \Errors::notFound(class_basename($this->model).' with id : '.$id); |
206 | 206 | } |
207 | 207 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | * @var array |
226 | 226 | */ |
227 | 227 | $model = Arr::has($data, 'id') ? $modelClass->lockForUpdate()->find($data['id']) : new $modelClass; |
228 | - if (! $model) { |
|
228 | + if ( ! $model) { |
|
229 | 229 | \Errors::notFound(class_basename($modelClass).' with id : '.$data['id']); |
230 | 230 | } |
231 | 231 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | * If the relation has no value then marke the relation data |
283 | 283 | * related to the model to be deleted. |
284 | 284 | */ |
285 | - if (! $value || ! count($value)) { |
|
285 | + if ( ! $value || ! count($value)) { |
|
286 | 286 | $relations[$relation] = 'delete'; |
287 | 287 | } |
288 | 288 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | /** |
310 | 310 | * If model doesn't exists. |
311 | 311 | */ |
312 | - if (! $relationModel) { |
|
312 | + if ( ! $relationModel) { |
|
313 | 313 | \Errors::notFound(class_basename($relationBaseModel).' with id : '.$val['id']); |
314 | 314 | } |
315 | 315 | |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | /** |
341 | 341 | * If model doesn't exists. |
342 | 342 | */ |
343 | - if (! $relationModel) { |
|
343 | + if ( ! $relationModel) { |
|
344 | 344 | \Errors::notFound(class_basename($relationBaseModel).' with id : '.$value['id']); |
345 | 345 | } |
346 | 346 | |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | $value = $removeLast === false ? $value : substr($value, 0, $removeLast); |
547 | 547 | $path = explode('->', $value); |
548 | 548 | $field = array_shift($path); |
549 | - $result = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) { |
|
549 | + $result = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function($part) { |
|
550 | 550 | return '"'.$part.'"'; |
551 | 551 | })->implode('.')); |
552 | 552 |
@@ -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->detachPermissions($userId); |
136 | 136 | $this->repo->attachPermissions($userId, $roleIds); |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function login($email, $password, $role = false) |
151 | 151 | { |
152 | - if (! $user = $this->repo->first(['email' => $email])) { |
|
152 | + if ( ! $user = $this->repo->first(['email' => $email])) { |
|
153 | 153 | \Errors::loginFailed(); |
154 | 154 | } elseif ($user->blocked) { |
155 | 155 | \Errors::userIsBlocked(); |
156 | - } elseif (! config('skeleton.disable_confirm_email') && ! $user->confirmed) { |
|
156 | + } elseif ( ! config('skeleton.disable_confirm_email') && ! $user->confirmed) { |
|
157 | 157 | \Errors::emailNotConfirmed(); |
158 | 158 | } |
159 | 159 | |
@@ -172,11 +172,11 @@ discard block |
||
172 | 172 | $access_token = $authCode ? Arr::get(\Socialite::driver($type)->getAccessTokenResponse($authCode), 'access_token') : $accessToken; |
173 | 173 | $user = \Socialite::driver($type)->userFromToken($access_token); |
174 | 174 | |
175 | - if (! $user->email) { |
|
175 | + if ( ! $user->email) { |
|
176 | 176 | \Errors::noSocialEmail(); |
177 | 177 | } |
178 | 178 | |
179 | - if (! $this->repo->first(['email' => $user->email])) { |
|
179 | + if ( ! $this->repo->first(['email' => $user->email])) { |
|
180 | 180 | $this->register($user->email, '', true); |
181 | 181 | } |
182 | 182 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | 'confirmed' => $skipConfirmEmail |
202 | 202 | ]); |
203 | 203 | |
204 | - if (! $skipConfirmEmail && ! config('skeleton.disable_confirm_email')) { |
|
204 | + if ( ! $skipConfirmEmail && ! config('skeleton.disable_confirm_email')) { |
|
205 | 205 | $this->sendConfirmationEmail($user->email); |
206 | 206 | } |
207 | 207 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | */ |
243 | 243 | public function sendReset($email) |
244 | 244 | { |
245 | - if (! $user = $this->repo->first(['email' => $email])) { |
|
245 | + if ( ! $user = $this->repo->first(['email' => $email])) { |
|
246 | 246 | \Errors::notFound('email'); |
247 | 247 | } |
248 | 248 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | 'password' => $password, |
267 | 267 | 'password_confirmation' => $passwordConfirmation, |
268 | 268 | 'token' => $token |
269 | - ], function ($user, $password) { |
|
269 | + ], function($user, $password) { |
|
270 | 270 | $this->repo->save(['id' => $user->id, 'password' => $password]); |
271 | 271 | }); |
272 | 272 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | public function changePassword($password, $oldPassword) |
300 | 300 | { |
301 | 301 | $user = \Auth::user(); |
302 | - if (! \Hash::check($oldPassword, $user->password)) { |
|
302 | + if ( ! \Hash::check($oldPassword, $user->password)) { |
|
303 | 303 | \Errors::invalidOldPassword(); |
304 | 304 | } |
305 | 305 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | public function confirmEmail($confirmationCode) |
316 | 316 | { |
317 | - if (! $user = $this->repo->first(['confirmation_code' => $confirmationCode])) { |
|
317 | + if ( ! $user = $this->repo->first(['confirmation_code' => $confirmationCode])) { |
|
318 | 318 | \Errors::invalidConfirmationCode(); |
319 | 319 | } |
320 | 320 |