2025-04-12 17:18:33 +03:00
|
|
|
@extends('layouts.app')
|
|
|
|
|
|
|
|
|
|
@section('title', $game->name)
|
|
|
|
|
|
|
|
|
|
@section('content')
|
2026-02-22 20:02:34 +02:00
|
|
|
<div class="container mt-4">
|
|
|
|
|
<!-- Main Game Info Section -->
|
|
|
|
|
<div class="row mb-4">
|
|
|
|
|
<!-- Left Column: Cover, Rating, Add to List -->
|
|
|
|
|
<div class="col-md-3">
|
|
|
|
|
<!-- Cover Image -->
|
|
|
|
|
<div class="game-cover position-relative mb-3">
|
|
|
|
|
<img src="{{ $game->cover_url }}" class="img-fluid rounded shadow-lg w-100" alt="{{ $game->name }}">
|
|
|
|
|
@if($game->rating)
|
|
|
|
|
<div class="position-absolute top-0 end-0 bg-dark bg-opacity-75 p-2 rounded-circle m-2 shadow">
|
|
|
|
|
<div class="d-flex align-items-center justify-content-center">
|
|
|
|
|
<span class="fw-bold text-warning">{{ number_format($game->rating, 1) }}</span>
|
2025-04-12 17:18:33 +03:00
|
|
|
</div>
|
2025-07-11 12:56:44 +03:00
|
|
|
</div>
|
2026-02-22 20:02:34 +02:00
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Rating Section -->
|
|
|
|
|
<div class="card bg-dark text-white mb-3">
|
|
|
|
|
<div class="card-body text-center">
|
|
|
|
|
<h5 class="card-title">Rating</h5>
|
2025-07-11 12:56:44 +03:00
|
|
|
@if($game->rating)
|
2026-02-22 20:02:34 +02:00
|
|
|
<div class="d-flex justify-content-center">
|
2025-07-11 12:56:44 +03:00
|
|
|
<div class="rating-stars d-flex gap-1">
|
|
|
|
|
@for($i = 1; $i <= 5; $i++)
|
|
|
|
|
<i class="fas fa-star {{ $i <= ($game->rating/20) ? 'text-warning' : 'text-secondary' }}"></i>
|
|
|
|
|
@endfor
|
|
|
|
|
</div>
|
|
|
|
|
<span class="ms-2">({{ number_format($game->rating_count) }} ratings)</span>
|
|
|
|
|
</div>
|
2026-02-22 20:02:34 +02:00
|
|
|
@else
|
|
|
|
|
<p class="text-muted">No ratings yet</p>
|
2025-07-11 12:56:44 +03:00
|
|
|
@endif
|
2026-02-22 20:02:34 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Add to List Button -->
|
|
|
|
|
@auth
|
|
|
|
|
<div class="dropdown mb-3 w-100">
|
|
|
|
|
<button class="btn btn-outline-primary dropdown-toggle w-100" type="button" id="addToListDropdown"
|
|
|
|
|
data-bs-toggle="dropdown" aria-expanded="false">
|
|
|
|
|
<i class="fas fa-plus me-2"></i>Add to List
|
|
|
|
|
</button>
|
|
|
|
|
<ul class="dropdown-menu dropdown-menu-dark w-100" aria-labelledby="addToListDropdown">
|
|
|
|
|
@foreach(Auth::user()->lists as $list)
|
|
|
|
|
<li>
|
|
|
|
|
<form action="{{ route('lists.addGame', $list) }}" method="POST" class="d-inline">
|
|
|
|
|
@csrf
|
|
|
|
|
<input type="hidden" name="game_id" value="{{ $game->id }}">
|
|
|
|
|
<button type="submit" class="dropdown-item">
|
|
|
|
|
<i class="fas fa-list me-2"></i>{{ $list->name }}
|
|
|
|
|
</button>
|
|
|
|
|
</form>
|
|
|
|
|
</li>
|
|
|
|
|
@endforeach
|
|
|
|
|
<li><hr class="dropdown-divider"></li>
|
|
|
|
|
<li>
|
|
|
|
|
<a class="dropdown-item" href="{{ route('lists.create') }}">
|
|
|
|
|
<i class="fas fa-plus me-2"></i>Create New List
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
@endauth
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Middle Column: Title, Release Date, Description -->
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<!-- Title and Release Date -->
|
|
|
|
|
<h1 class="fw-bold mb-2">{{ $game->name }}</h1>
|
|
|
|
|
<p class="text-muted mb-3">
|
|
|
|
|
<i class="far fa-calendar-alt me-2"></i> Released on {{ $game->first_release_date->format('F j, Y') }}
|
|
|
|
|
@if(isset($game->company))
|
|
|
|
|
by {{ $game->company }}
|
|
|
|
|
@endif
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<!-- Description -->
|
|
|
|
|
<div class="card bg-dark text-white mb-3">
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<h5 class="card-title mb-3">Description</h5>
|
|
|
|
|
<p class="card-text">{{ $game->summary }}</p>
|
|
|
|
|
@if($game->storyline)
|
|
|
|
|
<h6 class="mt-4 mb-2">Storyline</h6>
|
|
|
|
|
<p class="card-text">{{ $game->storyline }}</p>
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Right Column: Platforms, Genres -->
|
|
|
|
|
<div class="col-md-3">
|
|
|
|
|
<!-- Platforms -->
|
|
|
|
|
<div class="card bg-dark text-white mb-3">
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<h5 class="card-title mb-3">Platforms</h5>
|
|
|
|
|
<div class="d-flex flex-wrap gap-2">
|
|
|
|
|
@foreach($game->platforms()->get() as $platform)
|
|
|
|
|
<span class="badge bg-secondary">{{ $platform->name }}</span>
|
|
|
|
|
@endforeach
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Genres -->
|
|
|
|
|
<div class="card bg-dark text-white mb-3">
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<h5 class="card-title mb-3">Genres</h5>
|
|
|
|
|
<div class="d-flex flex-wrap gap-2">
|
|
|
|
|
@foreach($game->genres()->get() as $genre)
|
|
|
|
|
<span class="badge bg-primary">{{ $genre->name }}</span>
|
|
|
|
|
@endforeach
|
|
|
|
|
</div>
|
2025-04-12 17:18:33 +03:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-07-11 12:56:44 +03:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-12 17:18:33 +03:00
|
|
|
|
2026-02-22 20:02:34 +02:00
|
|
|
<!-- Bottom Section -->
|
|
|
|
|
<div class="row mb-4">
|
|
|
|
|
<!-- Left Column: Stats -->
|
|
|
|
|
<div class="col-md-4">
|
|
|
|
|
<div class="card bg-dark text-white mb-4">
|
|
|
|
|
<div class="card-header">
|
|
|
|
|
<h5 class="mb-0">Stats</h5>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<ul class="list-group list-group-flush bg-transparent">
|
|
|
|
|
<li class="list-group-item bg-dark text-white border-secondary">
|
|
|
|
|
<div class="d-flex justify-content-between">
|
|
|
|
|
<span><i class="far fa-calendar-alt me-2"></i>Release Date</span>
|
|
|
|
|
<span class="text-end">{{ $game->first_release_date->format('F j, Y') }}</span>
|
2025-07-11 12:56:44 +03:00
|
|
|
</div>
|
2026-02-22 20:02:34 +02:00
|
|
|
</li>
|
|
|
|
|
@if($game->rating)
|
|
|
|
|
<li class="list-group-item bg-dark text-white border-secondary">
|
|
|
|
|
<div class="d-flex justify-content-between">
|
|
|
|
|
<span><i class="fas fa-star me-2"></i>Rating</span>
|
|
|
|
|
<span class="text-end">{{ number_format($game->rating, 1) }}/100 ({{ number_format($game->rating_count) }} ratings)</span>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
@endif
|
|
|
|
|
@if($game->url)
|
|
|
|
|
<li class="list-group-item bg-dark text-white border-secondary">
|
|
|
|
|
<div class="d-flex justify-content-between">
|
|
|
|
|
<span><i class="fas fa-external-link-alt me-2"></i>Website</span>
|
|
|
|
|
<a href="{{ $game->url }}" target="_blank" class="text-primary">Visit</a>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
@endif
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
@if($reviews->isNotEmpty())
|
|
|
|
|
<div class="mt-4">
|
|
|
|
|
<h6 class="mb-3">Rating Distribution</h6>
|
|
|
|
|
@foreach($ratingDistribution as $rating)
|
|
|
|
|
<div class="d-flex align-items-center mb-2">
|
|
|
|
|
<div class="rating-label me-2" style="width: 30px;">{{ $rating['range'] }}</div>
|
|
|
|
|
<div class="progress flex-grow-1" style="height: 10px;">
|
|
|
|
|
<div class="progress-bar bg-warning" role="progressbar" style="width: {{ $rating['percentage'] }}%"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ms-2" style="width: 40px;">{{ $rating['count'] }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
@endforeach
|
2025-07-11 12:56:44 +03:00
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-02-22 20:02:34 +02:00
|
|
|
<!-- Right Column: Games on Series (Similar Games) -->
|
|
|
|
|
<div class="col-md-8">
|
|
|
|
|
@if($game->similar_games->count() > 0)
|
2025-07-11 12:56:44 +03:00
|
|
|
<div class="card bg-dark text-white mb-4">
|
2026-02-22 20:02:34 +02:00
|
|
|
<div class="card-header">
|
|
|
|
|
<h5 class="mb-0">Games on Series</h5>
|
2025-07-11 12:56:44 +03:00
|
|
|
</div>
|
2026-02-22 20:02:34 +02:00
|
|
|
<div class="card-body">
|
|
|
|
|
<div class="row g-3">
|
|
|
|
|
@foreach($game->similar_games as $similar)
|
|
|
|
|
<div class="col-md-6 col-lg-4">
|
|
|
|
|
<div class="card bg-dark h-100 hover-scale">
|
|
|
|
|
<a href="{{ route('games.show', $similar) }}" class="text-decoration-none">
|
|
|
|
|
<img src="{{ $similar->cover_url }}" class="card-img-top" alt="{{ $similar->name }}">
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<h6 class="card-title text-white">{{ $similar->name }}</h6>
|
|
|
|
|
<p class="card-text text-muted small">{{ $similar->first_release_date->format('Y') }}</p>
|
|
|
|
|
@if($similar->rating)
|
|
|
|
|
<div class="d-flex align-items-center mt-2">
|
|
|
|
|
<div class="rating-stars d-flex gap-1">
|
|
|
|
|
@for($i = 1; $i <= 5; $i++)
|
|
|
|
|
<i class="fas fa-star {{ $i <= ($similar->rating/20) ? 'text-warning' : 'text-secondary' }}"></i>
|
|
|
|
|
@endfor
|
|
|
|
|
</div>
|
|
|
|
|
<span class="ms-2 small">{{ number_format($similar->rating, 1) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
2025-07-11 12:56:44 +03:00
|
|
|
</a>
|
2025-04-12 17:18:33 +03:00
|
|
|
</div>
|
2026-02-22 20:02:34 +02:00
|
|
|
</div>
|
|
|
|
|
@endforeach
|
2025-04-12 17:18:33 +03:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-07-11 12:56:44 +03:00
|
|
|
</div>
|
2025-04-12 17:18:33 +03:00
|
|
|
@endif
|
|
|
|
|
|
2026-02-22 20:02:34 +02:00
|
|
|
@if($game->dlcs->count() > 0)
|
2025-07-11 12:56:44 +03:00
|
|
|
<div class="card bg-dark text-white mb-4">
|
2026-02-22 20:02:34 +02:00
|
|
|
<div class="card-header">
|
|
|
|
|
<h5 class="mb-0">DLCs & Expansions</h5>
|
2025-07-11 12:56:44 +03:00
|
|
|
</div>
|
2026-02-22 20:02:34 +02:00
|
|
|
<div class="card-body">
|
|
|
|
|
<div class="row g-3">
|
|
|
|
|
@foreach($game->dlcs as $dlc)
|
|
|
|
|
<div class="col-md-6 col-lg-4">
|
|
|
|
|
<div class="card bg-dark h-100">
|
|
|
|
|
<img src="{{ $dlc->cover_url }}" class="card-img-top" alt="{{ $dlc->name }}">
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<h6 class="card-title">{{ $dlc->name }}</h6>
|
|
|
|
|
<a href="{{ route('games.show', $dlc) }}" class="btn btn-sm btn-outline-primary mt-2">View Details</a>
|
2025-04-12 17:18:33 +03:00
|
|
|
</div>
|
2026-02-22 20:02:34 +02:00
|
|
|
</div>
|
2025-04-12 17:18:33 +03:00
|
|
|
</div>
|
2026-02-22 20:02:34 +02:00
|
|
|
@endforeach
|
2025-04-12 17:18:33 +03:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-07-11 12:56:44 +03:00
|
|
|
</div>
|
2025-04-12 17:18:33 +03:00
|
|
|
@endif
|
2025-07-11 12:56:44 +03:00
|
|
|
</div>
|
2026-02-22 20:02:34 +02:00
|
|
|
</div>
|
2025-04-12 17:18:33 +03:00
|
|
|
|
2026-02-22 20:02:34 +02:00
|
|
|
<!-- Latest Reviews Section -->
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-12">
|
2025-07-11 12:56:44 +03:00
|
|
|
<div class="card bg-dark text-white mb-4">
|
2025-04-12 17:18:33 +03:00
|
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
2026-02-22 20:02:34 +02:00
|
|
|
<h5 class="mb-0">Latest Reviews</h5>
|
2025-04-12 17:18:33 +03:00
|
|
|
@auth
|
|
|
|
|
<a href="{{ route('games.reviews.create', $game) }}" class="btn btn-gradient btn-sm">
|
|
|
|
|
<i class="fas fa-plus me-2"></i>Write a Review
|
|
|
|
|
</a>
|
|
|
|
|
@endauth
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
2026-02-22 20:02:34 +02:00
|
|
|
@if($reviews->isEmpty())
|
2025-07-11 12:56:44 +03:00
|
|
|
<div class="text-center py-5">
|
|
|
|
|
<i class="fas fa-comments fa-3x text-muted mb-3"></i>
|
|
|
|
|
<p class="text-muted mb-3">No reviews yet. Be the first to review this game!</p>
|
|
|
|
|
@auth
|
|
|
|
|
<a href="{{ route('games.reviews.create', $game) }}" class="btn btn-gradient">
|
|
|
|
|
<i class="fas fa-plus me-2"></i>Write a Review
|
|
|
|
|
</a>
|
|
|
|
|
@else
|
|
|
|
|
<a href="{{ route('login') }}" class="btn btn-gradient">
|
|
|
|
|
<i class="fas fa-sign-in-alt me-2"></i>Login to Write a Review
|
|
|
|
|
</a>
|
|
|
|
|
@endauth
|
|
|
|
|
</div>
|
2025-04-12 17:18:33 +03:00
|
|
|
@else
|
2025-07-11 12:56:44 +03:00
|
|
|
<div class="reviews-list">
|
2026-02-22 20:02:34 +02:00
|
|
|
@foreach($reviews->take(3) as $review)
|
2025-07-11 12:56:44 +03:00
|
|
|
<div class="card bg-dark border-secondary mb-4">
|
|
|
|
|
<div class="card-header">
|
|
|
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
|
|
|
<div class="d-flex align-items-center">
|
|
|
|
|
<div class="me-3">
|
|
|
|
|
<i class="fas fa-user-circle fa-2x"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<h6 class="mb-0">
|
|
|
|
|
<a href="{{ route('profile.show', $review->user) }}" class="text-white text-decoration-none">
|
|
|
|
|
{{ $review->user->name }}
|
|
|
|
|
</a>
|
|
|
|
|
</h6>
|
|
|
|
|
<small class="text-muted">
|
|
|
|
|
<i class="far fa-clock"></i> {{ $review->created_at->diffForHumans() }}
|
|
|
|
|
</small>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="d-flex align-items-center">
|
2026-02-22 20:02:34 +02:00
|
|
|
<div class="rating-badge me-2 px-2 py-1 rounded" style="background-color: {{ $review->rating >= 7 ? '#28a745' : ($review->rating >= 5 ? '#ffc107' : '#dc3545') }};">
|
|
|
|
|
<span class="fw-bold">{{ $review->rating }}/10</span>
|
2025-07-11 12:56:44 +03:00
|
|
|
</div>
|
|
|
|
|
@if($review->recommended)
|
|
|
|
|
<span class="badge bg-success">Recommended</span>
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<div class="review-content">
|
|
|
|
|
{!! nl2br(e(Str::limit($review->content, 300))) !!}
|
|
|
|
|
@if(strlen($review->content) > 300)
|
|
|
|
|
<a href="{{ route('reviews.show', $review) }}" class="text-primary">Read more</a>
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-footer bg-dark border-top border-secondary">
|
|
|
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
|
|
|
<a href="{{ route('reviews.show', $review) }}" class="btn btn-link text-white p-0">
|
|
|
|
|
Read full review
|
|
|
|
|
</a>
|
|
|
|
|
@if(auth()->id() === $review->user_id)
|
|
|
|
|
<div class="d-flex gap-2">
|
|
|
|
|
<a href="{{ route('reviews.edit', $review) }}" class="btn btn-outline-primary btn-sm">
|
|
|
|
|
<i class="fas fa-edit"></i> Edit
|
|
|
|
|
</a>
|
|
|
|
|
<form action="{{ route('reviews.destroy', $review) }}" method="POST" class="d-inline">
|
|
|
|
|
@csrf
|
|
|
|
|
@method('DELETE')
|
|
|
|
|
<button type="submit" class="btn btn-outline-danger btn-sm" onclick="return confirm('Are you sure you want to delete this review?')">
|
|
|
|
|
<i class="fas fa-trash"></i> Delete
|
|
|
|
|
</button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
2025-04-12 23:28:09 +03:00
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-07-11 12:56:44 +03:00
|
|
|
@endforeach
|
2026-02-22 20:02:34 +02:00
|
|
|
|
|
|
|
|
@if($reviews->count() > 3)
|
|
|
|
|
<div class="text-center mt-3">
|
|
|
|
|
<a href="{{ route('games.reviews.index', $game) }}" class="btn btn-outline-primary">
|
|
|
|
|
View All {{ $reviews->count() }} Reviews
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
2025-07-11 12:56:44 +03:00
|
|
|
</div>
|
2025-04-12 17:18:33 +03:00
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-07-11 12:56:44 +03:00
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.hover-scale {
|
|
|
|
|
transition: transform 0.3s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.hover-scale:hover {
|
|
|
|
|
transform: scale(1.03);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-gradient {
|
|
|
|
|
background: linear-gradient(90deg, var(--primary), var(--accent));
|
|
|
|
|
border: none;
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-gradient:hover {
|
|
|
|
|
opacity: 0.9;
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-outline-primary {
|
|
|
|
|
border-color: var(--primary);
|
|
|
|
|
color: var(--primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-outline-primary:hover {
|
|
|
|
|
background-color: var(--primary);
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
2025-04-12 17:18:33 +03:00
|
|
|
@endsection
|