@extends('layouts.app-admin') @section('content')
@php // Generate dummy product data based on ID $productId = $id; $productNumber = 'MSC-' . rand(100, 999) . '-' . rand(1000, 9999); $types = ['license', 'physical', 'digital', 'service', 'others']; $type = $types[array_rand($types)]; $licenseTypes = ['cover', 'commercial', 'royalty']; $licenseType = $type === 'license' ? $licenseTypes[array_rand($licenseTypes)] : null; $product = [ 'id' => $productId, 'number' => $productNumber, 'name' => 'Product ' . substr($productId, -3) . ' ' . ucfirst($type) . ($licenseType ? ' ' . ucfirst($licenseType) : ''), 'description' => 'This is a detailed description for the product. It includes information about what the product offers, its benefits, and any special features. This product is designed to meet the needs of musicians and content creators.', 'type' => $type, 'license_type' => $licenseType, 'price' => rand(5, 500) * 1000, 'picture' => 'https://picsum.photos/id/' . (intval(substr($productId, -3)) + 10) . '/800/600', 'created_at' => now()->subDays(rand(1, 60))->format('Y-m-d H:i:s'), 'updated_at' => now()->subDays(rand(0, 30))->format('Y-m-d H:i:s'), 'song_id' => $type === 'license' ? 'song-' . rand(1, 10) : null, 'song_title' => $type === 'license' ? 'Song Title ' . rand(1, 10) : null, 'artist_id' => $type === 'service' ? 'artist-' . rand(1, 10) : null, 'artist_name' => $type === 'service' ? 'Artist Name ' . rand(1, 10) : null, 'available_start' => $type === 'service' ? now()->addDays(rand(1, 30))->format('Y-m-d H:i:s') : null, 'available_end' => $type === 'service' ? now()->addDays(rand(31, 60))->format('Y-m-d H:i:s') : null, 'file' => $type === 'digital' || $type === 'physical' ? 'product_file_' . rand(1000, 9999) . '.zip' : null, ]; @endphp

Product Information

Product Number
{{ $product['number'] }}
Product Name
{{ $product['name'] }}
Type
{{ ucfirst($product['type']) }}
Price
Rp {{ number_format($product['price'], 0, ',', '.') }}
Created
{{ \Carbon\Carbon::parse($product['created_at'])->format('d M Y H:i') }}
Last Updated
{{ \Carbon\Carbon::parse($product['updated_at'])->format('d M Y H:i') }}

Description

{{ $product['description'] }}

@if ($product['type'] === 'license')

License Details

License Type
{{ ucfirst($product['license_type']) }}
Song
{{ $product['song_title'] }}
@endif @if ($product['type'] === 'digital' || $product['type'] === 'physical')

{{ ucfirst($product['type']) }} Product Details

@endif @if ($product['type'] === 'service')

Service Details

Artist
{{ $product['artist_name'] }}
Available From
{{ \Carbon\Carbon::parse($product['available_start'])->format('d M Y H:i') }}
Available Until
{{ \Carbon\Carbon::parse($product['available_end'])->format('d M Y H:i') }}
@endif

Product Image

{{ $product['name'] }}

Actions

@endsection @section('scripts') @endsection