@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.', '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