@php use App\Models\Game; use App\Models\GameList; use App\Models\Genre; use App\Models\Platform; // Turn $game->genre_ids into an array. $genres = explode(',', $game->genre_ids); // Determine the friendly genre name(s). $genreNames = []; foreach ($genres as $genre) { array_push($genreNames, Genre::whereId($genre)->value('name')); } // Create a comma separated string of the genre names. $genreNames = implode(', ', $genreNames); // Determine what other platforms this game exists on. $alsoExistsOn = Game::whereName($game->name)->where('id', '!=', $game->id)->get(); $platforms = []; if (count($alsoExistsOn) >= 1) { foreach ($alsoExistsOn as $alsoExistsOnGame) { array_push($platforms, [ 'id' => $alsoExistsOnGame->id, 'name' => Platform::whereId($alsoExistsOnGame->platform_id)->value('name'), ]); } } @endphp {{-- Check to see if the user is logged in. --}} @if (Auth::check()) {{-- Check to see if the user has this game on their list already. --}} @php $hasGame = GameList::whereUserId(Auth::user()->id)->whereGameId($game->id)->first(); @endphp {{-- Check to see if the user has this game favorited already. --}} {{-- Check to see if the user has this wishlisted already. --}} @endif

{{ $game->name }}

@if (Auth::check())
@else
@endif
{!! Markdown::parse($game->description) !!} @if ($game->source)

Source.

@endif

Comments

Coming soon...

Game Information

image
@if ($game->alt_titles) @php $altTitles = str_replace('|', ', ', $game->alt_titles); @endphp
Alternative Titles
{{ $altTitles }}
@endif
Platform
{{ $game->platform()->get()[0]->name }}
Developer(s)
{{ $game->developers ?? '-' }}
Publishers(s)
{{ $game->publishers ?? '-' }}
Genres(s)
{{ $genreNames }}
@if ($game->na_release_date)
NA Release Date
{{ $game->na_release_date }}
@endif @if ($game->jp_release_date)
JP Release Date
{{ $game->jp_release_date }}
@endif @if ($game->eu_release_date)
EU Release Date
{{ $game->eu_release_date }}
@endif @if ($game->aus_release_date)
AUS Release Date
{{ $game->aus_release_date }}
@endif @if ($game->esrb_rating)
ESRB Rating
{{ $game->esrb_rating ?? '-' }}
@endif @if ($game->pegi_rating)
PEGI Rating
{{ $game->pegi_rating ?? '-' }}
@endif @if ($game->cero_rating)
CERO Rating
{{ $game->cero_rating ?? '-' }}
@endif @if ($game->acb_rating)
ACB Rating
{{ $game->acb_rating ?? '-' }}
@endif
MVGL User Score
{{ (round(GameList::whereGameId($game->id)->avg('rating'), 1)) != 0 ? round(GameList::whereGameId($game->id)->avg('rating'), 1) : '-'}} {{ (GameList::whereGameId($game->id)->where('rating', '>=', 1)->count()) != 0 ? ' by ' . GameList::whereGameId($game->id)->where('rating', '>=', 1)->count() . ' user(s) ' : '' }}
MVGL Difficulty
{{ GameList::whereGameId($game->id)->avg('difficulty') ?? '-' }}
Composer(s)
{{ $game->composers ?? '-' }}
@if ($game->website)
Website
Official Website
@endif
Added by
{{ GameList::whereGameId($game->id)->count() ?? '0' }} User(s)
@if (count($alsoExistsOn) >= 1)

This game also exists on:
@foreach ($platforms as $platform) {{ $platform['name'] }} @endforeach

@endif

Recently Completed By

Coming soon...

Recently Favorited By

Coming soon...