From 7593ae4c3b881c00ef13476ed3e77de22d7c6e0f Mon Sep 17 00:00:00 2001 From: Francisco Madeira Date: Sat, 28 May 2022 02:02:28 +0100 Subject: [PATCH] style: fixes. --- app/Apis/LiveScoresApi.php | 5 +-- app/Scores.php | 2 +- .../views/components/sport-leagues.blade.php | 29 ++++++++-------- resources/views/games.blade.php | 33 +++++++++---------- 4 files changed, 31 insertions(+), 38 deletions(-) diff --git a/app/Apis/LiveScoresApi.php b/app/Apis/LiveScoresApi.php index 79969d7..0ef6823 100644 --- a/app/Apis/LiveScoresApi.php +++ b/app/Apis/LiveScoresApi.php @@ -37,10 +37,7 @@ public function fetch(): Collection public function makeRequest(): Collection { - return $this->client() - ->get('/soccer/1.00?MD=1') - ->throw() - ->collect(); + return collect(); } protected function client(): PendingRequest diff --git a/app/Scores.php b/app/Scores.php index c7ef46f..71bc3de 100644 --- a/app/Scores.php +++ b/app/Scores.php @@ -12,7 +12,7 @@ class Scores /** * List of supported Sports. * - * @var string[] + * @var array */ public static $sportsAvailable = [ 'football' => FootballApi::class, diff --git a/resources/views/components/sport-leagues.blade.php b/resources/views/components/sport-leagues.blade.php index 9628b22..94d8435 100644 --- a/resources/views/components/sport-leagues.blade.php +++ b/resources/views/components/sport-leagues.blade.php @@ -1,18 +1,17 @@ @props(['sport', 'leagues', 'title', 'titleClass'])
{{ $title }}
- @foreach ($leagues as $league) -
- +@foreach ($leagues as $league) +
+ - @foreach ($league['games'] as $game) - - @endforeach -
- @endforeach -
+ @foreach ($league['games'] as $game) + + @endforeach + +@endforeach diff --git a/resources/views/games.blade.php b/resources/views/games.blade.php index 399ba95..8464aac 100644 --- a/resources/views/games.blade.php +++ b/resources/views/games.blade.php @@ -1,23 +1,20 @@
{{--
Select a game:
--}} @foreach ($sports as $sport => $leagues) - @switch ($sport) - @case('football') - - @break - @case('basketball') - - @break - @endswitch + @if ($sport === 'football') + + @elseif ($sport === 'basketball') + + @endif @endforeach