@extends('layouts.app') @section('title', $product->name) @section('content')
@if($product->image)
{{ $product->name }} @if($product->sale_price && $product->sale_price < $product->price) SALE @endif
@else
@endif @if($product->gallery->count())
@foreach($product->gallery as $image)
@endforeach
@endif
🎮 {{ $product->game->name ?? 'N/A' }}

{{ $product->name }}

@if($product->sale_price && $product->sale_price < $product->price)
{{ currency($product->sale_price) }} {{ currency($product->price) }} Hemat {{ number_format(($product->price - $product->sale_price) / $product->price * 100, 0) }}%
@else {{ currency($product->price) }} @endif
({{ currency_code() }})
Stock: @if($product->stock > 0) {{ $product->stock }} available (Ready to ship) @else Out of stock @endif
@if($product->description)

Description

{{ $product->description }}
@endif @if($product->stock > 0)
@csrf
@else @endif @if($product->tutorial_video)

Tutorial Video

@php $videoId = null; $url = $product->tutorial_video; if (preg_match('/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/', $url, $matches)) { $videoId = $matches[1]; } @endphp @if($videoId)
@else Watch on YouTube @endif
@endif

Customer Reviews

@if(session('user_id'))
@csrf
@for($i = 1; $i <= 5; $i++) @endfor
@else
Please login to write a review.
@endif
@forelse($product->reviews as $review)
{{ substr($review->user->username ?? 'A', 0, 1) }}
{{ $review->user->username ?? 'Anonymous' }}

{{ \Carbon\Carbon::parse($review->created_at)->format('d M Y') }}

{{ str_repeat('★', $review->rating) }}{{ str_repeat('☆', 5 - $review->rating) }}
({{ $review->rating }}/5)

{{ $review->comment }}

@empty

No reviews yet. Be the first to review this product!

@endforelse
@if($related->count())
@endif
@endsection