@@ -45,12 +45,12 @@ |
||
| 45 | 45 | protected function pageNumber(int $pageNumber, int $itemCount, string $bagName, string $attrName = 'page'): array |
| 46 | 46 | { |
| 47 | 47 | $perPage = 10; |
| 48 | - $pageCount = (int)floor($itemCount / $perPage) + ($itemCount % $perPage > 0 ? 1 : 0); |
|
| 49 | - if($pageNumber > $pageCount) |
|
| 48 | + $pageCount = (int) floor($itemCount / $perPage) + ($itemCount % $perPage > 0 ? 1 : 0); |
|
| 49 | + if ($pageNumber > $pageCount) |
|
| 50 | 50 | { |
| 51 | 51 | $pageNumber = $pageCount; |
| 52 | 52 | } |
| 53 | - if($pageNumber < 1) |
|
| 53 | + if ($pageNumber < 1) |
|
| 54 | 54 | { |
| 55 | 55 | $pageNumber = $this->bag($bagName)->get($attrName, 1); |
| 56 | 56 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | protected function commands() |
| 27 | 27 | { |
| 28 | - $this->load(__DIR__.'/Commands'); |
|
| 28 | + $this->load(__DIR__ . '/Commands'); |
|
| 29 | 29 | |
| 30 | 30 | require base_path('routes/console.php'); |
| 31 | 31 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | 'locales' => LaravelLocalization::getSupportedLocales(), |
| 53 | 53 | 'locale' => LaravelLocalization::getCurrentLocale(), |
| 54 | 54 | 'localeNative' => LaravelLocalization::getCurrentLocaleNative(), |
| 55 | - ]); |
|
| 55 | + ]); |
|
| 56 | 56 | |
| 57 | 57 | return view('tontine.base.profile', ['countries' => $localeService->getCountries()]); |
| 58 | 58 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | $this->configureRateLimiting(); |
| 30 | 30 | |
| 31 | - $this->routes(function () { |
|
| 31 | + $this->routes(function() { |
|
| 32 | 32 | Route::middleware('api') |
| 33 | 33 | ->prefix('api') |
| 34 | 34 | ->group(base_path('routes/api.php')); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | protected function configureRateLimiting() |
| 47 | 47 | { |
| 48 | - RateLimiter::for('api', function (Request $request) { |
|
| 48 | + RateLimiter::for ('api', function(Request $request) { |
|
| 49 | 49 | return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); |
| 50 | 50 | }); |
| 51 | 51 | } |
@@ -49,13 +49,13 @@ |
||
| 49 | 49 | Fortify::updateUserPasswordsUsing(UpdateUserPassword::class); |
| 50 | 50 | Fortify::resetUserPasswordsUsing(ResetUserPassword::class); |
| 51 | 51 | |
| 52 | - RateLimiter::for('login', function(Request $request) { |
|
| 52 | + RateLimiter::for ('login', function(Request $request) { |
|
| 53 | 53 | $email = (string) $request->email; |
| 54 | 54 | |
| 55 | - return Limit::perMinute(5)->by($email.$request->ip()); |
|
| 55 | + return Limit::perMinute(5)->by($email . $request->ip()); |
|
| 56 | 56 | }); |
| 57 | 57 | |
| 58 | - RateLimiter::for('two-factor', function(Request $request) { |
|
| 58 | + RateLimiter::for ('two-factor', function(Request $request) { |
|
| 59 | 59 | return Limit::perMinute(5)->by($request->session()->get('login.id')); |
| 60 | 60 | }); |
| 61 | 61 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | // Force redirect to HTTPS. |
| 30 | 30 | $url = $this->app['url']; |
| 31 | - if($this->app->environment('production')) |
|
| 31 | + if ($this->app->environment('production')) |
|
| 32 | 32 | { |
| 33 | 33 | $url->forceScheme('https'); |
| 34 | 34 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $session = $this->tenantService->getSession($sessionId); |
| 47 | 47 | $html = view('tontine.report.session', $this->reportService->getSessionReport($session)); |
| 48 | 48 | // Show the html page |
| 49 | - if($request->has('html')) |
|
| 49 | + if ($request->has('html')) |
|
| 50 | 50 | { |
| 51 | 51 | return $html; |
| 52 | 52 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $round = $this->tenantService->tontine()->rounds()->find($roundId); |
| 75 | 75 | $html = view('tontine.report.round', $this->reportService->getRoundReport($round)); |
| 76 | 76 | // Show the html page |
| 77 | - if($request->has('html')) |
|
| 77 | + if ($request->has('html')) |
|
| 78 | 78 | { |
| 79 | 79 | return $html; |
| 80 | 80 | } |
@@ -36,10 +36,10 @@ |
||
| 36 | 36 | { |
| 37 | 37 | return parent::handle($request, $next); |
| 38 | 38 | } |
| 39 | - catch(TokenMismatchException $e) |
|
| 39 | + catch (TokenMismatchException $e) |
|
| 40 | 40 | { |
| 41 | 41 | $jaxon = App::make(Jaxon::class); |
| 42 | - if($jaxon->canProcessRequest()) // We have an ajax request with Jaxon |
|
| 42 | + if ($jaxon->canProcessRequest()) // We have an ajax request with Jaxon |
|
| 43 | 43 | { |
| 44 | 44 | throw new AuthenticationException(); |
| 45 | 45 | } |
@@ -35,14 +35,15 @@ |
||
| 35 | 35 | try |
| 36 | 36 | { |
| 37 | 37 | return parent::handle($request, $next); |
| 38 | - } |
|
| 39 | - catch(TokenMismatchException $e) |
|
| 38 | + } catch(TokenMismatchException $e) |
|
| 40 | 39 | { |
| 41 | 40 | $jaxon = App::make(Jaxon::class); |
| 42 | - if($jaxon->canProcessRequest()) // We have an ajax request with Jaxon |
|
| 41 | + if($jaxon->canProcessRequest()) { |
|
| 42 | + // We have an ajax request with Jaxon |
|
| 43 | 43 | { |
| 44 | 44 | throw new AuthenticationException(); |
| 45 | 45 | } |
| 46 | + } |
|
| 46 | 47 | |
| 47 | 48 | throw $e; |
| 48 | 49 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | private function getLatestTontine(User $user): ?Tontine |
| 41 | 41 | { |
| 42 | 42 | $tontine = null; |
| 43 | - if(($tontineId = session('tontine.id', 0)) > 0) |
|
| 43 | + if (($tontineId = session('tontine.id', 0)) > 0) |
|
| 44 | 44 | { |
| 45 | 45 | $tontine = $user->tontines()->find($tontineId); |
| 46 | 46 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | private function getLatestRound(Tontine $tontine): ?Round |
| 58 | 58 | { |
| 59 | 59 | $round = null; |
| 60 | - if(($roundId = session('round.id', 0)) > 0) |
|
| 60 | + if (($roundId = session('round.id', 0)) > 0) |
|
| 61 | 61 | { |
| 62 | 62 | $round = $tontine->rounds()->find($roundId); |
| 63 | 63 | } |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $tontineId = 0; |
| 82 | 82 | $roundId = 0; |
| 83 | - if(($tontine = $this->getLatestTontine($user)) !== null) |
|
| 83 | + if (($tontine = $this->getLatestTontine($user)) !== null) |
|
| 84 | 84 | { |
| 85 | 85 | $tontineId = $tontine->id; |
| 86 | 86 | $this->tenantService->setTontine($tontine); |
| 87 | - if(($round = $this->getLatestRound($tontine)) !== null) |
|
| 87 | + if (($round = $this->getLatestRound($tontine)) !== null) |
|
| 88 | 88 | { |
| 89 | 89 | $roundId = $round->id; |
| 90 | 90 | $this->tenantService->setRound($round); |