@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public function boot() |
28 | 28 | { |
29 | - $this->app['auth']->viaRequest('api', function ($request) { |
|
29 | + $this->app['auth']->viaRequest('api', function($request) { |
|
30 | 30 | if ($request->header('Authorization')) { |
31 | 31 | $requestToken = explode(' ', $request->header('Authorization')); |
32 | 32 |
@@ -41,9 +41,9 @@ |
||
41 | 41 | */ |
42 | 42 | public function handle() |
43 | 43 | { |
44 | - Redis::throttle('key')->block(0)->allow(1)->every(1)->then(function () { |
|
44 | + Redis::throttle('key')->block(0)->allow(1)->every(1)->then(function() { |
|
45 | 45 | Mail::send($this->sendMail); |
46 | - }, function () { |
|
46 | + }, function() { |
|
47 | 47 | $this->release(5); |
48 | 48 | }); |
49 | 49 | } |
@@ -20,14 +20,14 @@ |
||
20 | 20 | /** |
21 | 21 | * Validate alpha spaces |
22 | 22 | */ |
23 | - Validator::extend('name', function ($attribute, $value) { |
|
23 | + Validator::extend('name', function($attribute, $value) { |
|
24 | 24 | return preg_match('/^[\pL\s\']+$/u', $value); |
25 | 25 | }); |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * Validate phone number |
29 | 29 | */ |
30 | - Validator::extend('phone', function ($attribute, $value) { |
|
30 | + Validator::extend('phone', function($attribute, $value) { |
|
31 | 31 | $conditions = []; |
32 | 32 | $conditions[] = strlen($value) >= 10; |
33 | 33 | $conditions[] = strlen($value) <= 16; |
@@ -230,7 +230,7 @@ |
||
230 | 230 | DB::beginTransaction(); |
231 | 231 | |
232 | 232 | $userTokens = UserToken::where('user_id', $user->id) |
233 | - ->where('type', UserToken::TYPE_REMEMBER_ME); |
|
233 | + ->where('type', UserToken::TYPE_REMEMBER_ME); |
|
234 | 234 | |
235 | 235 | if ($request->has('rememberToken')) { |
236 | 236 | $userTokens = $userTokens->where('token', $request->get('rememberToken')); |
@@ -72,8 +72,8 @@ |
||
72 | 72 | private function checkExpiringTasks() |
73 | 73 | { |
74 | 74 | $expiringUserTasks = UserTask::where('status', UserTask::STATUS_ASSIGNED) |
75 | - ->where('deadline', Carbon::now()->format('Y-m-d')) |
|
76 | - ->get(); |
|
75 | + ->where('deadline', Carbon::now()->format('Y-m-d')) |
|
76 | + ->get(); |
|
77 | 77 | |
78 | 78 | $this->info('[' . Carbon::now()->format('Y-m-d H:i:s') . ']: Found ' . $expiringUserTasks->count() . ' expiring tasks.'); |
79 | 79 |
@@ -58,7 +58,7 @@ |
||
58 | 58 | private function removeExpiredTokens() |
59 | 59 | { |
60 | 60 | $userTokens = UserToken::where('expire_on', '<=', Carbon::now()->format('Y-m-d H:i:s')) |
61 | - ->get(); |
|
61 | + ->get(); |
|
62 | 62 | |
63 | 63 | $this->info('[' . Carbon::now()->format('Y-m-d H:i:s') . ']: Found ' . $userTokens->count() . ' tokens to be removed.'); |
64 | 64 |
@@ -32,11 +32,11 @@ |
||
32 | 32 | protected function schedule(Schedule $schedule) |
33 | 33 | { |
34 | 34 | $schedule->command('delete:expiredTokens') |
35 | - ->daily()->at('4:00') |
|
36 | - ->appendOutputTo(storage_path('logs/cron_delete_expired_tokens.log')); |
|
35 | + ->daily()->at('4:00') |
|
36 | + ->appendOutputTo(storage_path('logs/cron_delete_expired_tokens.log')); |
|
37 | 37 | |
38 | 38 | $schedule->command('send:taskNotifications') |
39 | - ->daily()->at('8:00') |
|
40 | - ->appendOutputTo(storage_path('logs/cron_send_task_notifications.log')); |
|
39 | + ->daily()->at('8:00') |
|
40 | + ->appendOutputTo(storage_path('logs/cron_send_task_notifications.log')); |
|
41 | 41 | } |
42 | 42 | } |
@@ -29,16 +29,16 @@ |
||
29 | 29 | $user = Auth::user(); |
30 | 30 | |
31 | 31 | $userTasks = UserTask::with([ |
32 | - 'user' => function ($query) { |
|
32 | + 'user' => function($query) { |
|
33 | 33 | $query->select(['id', 'name']); |
34 | 34 | }, |
35 | - 'assignedUser' => function ($query) { |
|
35 | + 'assignedUser' => function($query) { |
|
36 | 36 | $query->select(['id', 'name']); |
37 | 37 | } |
38 | 38 | ]); |
39 | 39 | |
40 | 40 | if ($canManage === RolePermission::MANAGE_OWN) { |
41 | - $userTasks = $userTasks->where(function ($query) use ($user, $onlyOwn) { |
|
41 | + $userTasks = $userTasks->where(function($query) use ($user, $onlyOwn) { |
|
42 | 42 | $query->where('user_id', $user->id); |
43 | 43 | |
44 | 44 | if (!$onlyOwn) { |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | return User::with([ |
110 | 110 | 'role' => function ($query) { |
111 | 111 | $query->select(['id', 'name']) |
112 | - ->with(['permissions']); |
|
112 | + ->with(['permissions']); |
|
113 | 113 | } |
114 | 114 | ]); |
115 | 115 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | /** @var User|null $user */ |
175 | 175 | $user = $builder->whereHas('userTokens', function ($query) use ($token) { |
176 | 176 | $query->where('token', $token) |
177 | - ->where('expire_on', '>=', Carbon::now()->format('Y-m-d H:i:s')); |
|
177 | + ->where('expire_on', '>=', Carbon::now()->format('Y-m-d H:i:s')); |
|
178 | 178 | })->first(); |
179 | 179 | |
180 | 180 | return $user; |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | public function updateRememberTokenValability($token, $days = 14) |
190 | 190 | { |
191 | 191 | $userToken = UserToken::where('token', $token) |
192 | - ->where('type', UserToken::TYPE_REMEMBER_ME) |
|
193 | - ->first(); |
|
192 | + ->where('type', UserToken::TYPE_REMEMBER_ME) |
|
193 | + ->first(); |
|
194 | 194 | |
195 | 195 | if ($userToken) { |
196 | 196 | $userToken->expire_on = Carbon::now()->addDays($days)->format('Y-m-d H:i:s'); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | |
259 | 259 | $user = $builder->where(function ($query) use ($socialUser, $socialId) { |
260 | 260 | $query->where($socialId, $socialUser->getId()) |
261 | - ->orWhereEncrypted('email', $socialUser->getEmail()); |
|
261 | + ->orWhereEncrypted('email', $socialUser->getEmail()); |
|
262 | 262 | })->first(); |
263 | 263 | |
264 | 264 | if (!$user) { |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | public static function getUserBuilderForLogin() |
108 | 108 | { |
109 | 109 | return User::with([ |
110 | - 'role' => function ($query) { |
|
110 | + 'role' => function($query) { |
|
111 | 111 | $query->select(['id', 'name']) |
112 | 112 | ->with(['permissions']); |
113 | 113 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $builder = self::getUserBuilderForLogin(); |
173 | 173 | |
174 | 174 | /** @var User|null $user */ |
175 | - $user = $builder->whereHas('userTokens', function ($query) use ($token) { |
|
175 | + $user = $builder->whereHas('userTokens', function($query) use ($token) { |
|
176 | 176 | $query->where('token', $token) |
177 | 177 | ->where('expire_on', '>=', Carbon::now()->format('Y-m-d H:i:s')); |
178 | 178 | })->first(); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | { |
257 | 257 | $builder = self::getUserBuilderForLogin(); |
258 | 258 | |
259 | - $user = $builder->where(function ($query) use ($socialUser, $socialId) { |
|
259 | + $user = $builder->where(function($query) use ($socialUser, $socialId) { |
|
260 | 260 | $query->where($socialId, $socialUser->getId()) |
261 | 261 | ->orWhereEncrypted('email', $socialUser->getEmail()); |
262 | 262 | })->first(); |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | * @param Request $request |
368 | 368 | * @param Language $language |
369 | 369 | */ |
370 | - public function updateLoggedUser(User &$user, Request $request, Language $language) |
|
370 | + public function updateLoggedUser(User & $user, Request $request, Language $language) |
|
371 | 371 | { |
372 | 372 | $email = $request->get('email'); |
373 | 373 | $confirmEmail = false; |