@extends('layouts.app') @section('title', $productMaster->product_name . ' - Master Details - Quotation App') @section('styles') @endsection @section('content')
Product Name
{{ $productMaster->product_name }}
Models Available
{{ $productMaster->products->unique('product_model')->count() }} Models
@if($productMaster->product_image) {{ $productMaster->product_name }} @else
📷 No Image
@endif

📋 Product Models ({{ $productMaster->products->unique('product_model')->count() }})

@if($productMaster->products->count() > 0) @php // Get unique models with their first product record $uniqueModels = $productMaster->products->unique('product_model')->values(); @endphp @foreach($uniqueModels as $product) @endforeach
# Master Product Model Price Specifications Actions
{{ $loop->iteration }} {{ $productMaster->product_name }} {{ $product->product_model }} ₹{{ number_format($product->default_price, 2) }} @php $uniqueSpecs = $productMaster->products ->where('product_model', $product->product_model) ->where('product_master_id', $productMaster->id) ->filter(fn($p) => $p->spec_name) ->unique(fn($p) => $p->spec_name) ->values(); @endphp @if($uniqueSpecs->count() > 0)
@foreach($uniqueSpecs as $spec) {{ $spec->spec_name }}: {{ $spec->spec_value }}{{ $spec->spec_unit ? ' ' . $spec->spec_unit : '' }} @endforeach
@else No specifications @endif
Edit
@csrf @method('DELETE')
@else

No Models yet

Click the "Add New Model" button to create your first model for this master.

@endif
@php $stdAccessories = $productMaster->getStandardAccessoriesArray(); $optAccessories = $productMaster->getOptionalAccessoriesArray(); @endphp @if(!empty($stdAccessories) || !empty($optAccessories))
@if(!empty($stdAccessories))

✓ Standard Accessories

@endif @if(!empty($optAccessories))

◇ Optional Accessories

@endif
@endif @endsection