@extends('layouts/contentLayoutMaster') @section('title', 'Jobs') @section('vendor-style') {{-- Page Css files --}} @endsection @section('page-style') {{-- Page Css files --}} @endsection @section('content')
{{-- Page header / toolbar --}}
{{ $model->code }}
Back
@php $specsRaw = $model->specs ?? []; // or the JSON you have $specs = is_array($specsRaw) ? $specsRaw : (json_decode($specsRaw ?? '[]', true) ?? []); $now = now(); $due = $model->due_at ?? null; $dueDiffMins = $due ? $now->diffInMinutes($due, false) : null; // negative if overdue $dueBadgeClass = $due ? ($dueDiffMins < 0 ? 'bg-danger' : ($dueDiffMins <=180 ? 'bg-warning text-dark' : 'bg-success' )) : 'bg-secondary' ; $dueTitle=$due ? ($dueDiffMins < 0 ? 'Overdue by ' .$now->diffForHumans($due, ['parts' => 2, 'short'=>true, 'syntax'=>\Carbon\CarbonInterface::DIFF_ABSOLUTE]) : 'Due in '.$due->diffForHumans($now, ['parts' => 2, 'short'=>true])) : 'No due date'; @endphp {{-- Top: Details + Codes + Status --}}
@php $orderItem = $model->orderItem; $itemable = $orderItem?->itemable; $isDesign = $itemable && get_class($itemable) === \App\Models\Design::class; $isTemplate = $itemable && get_class($itemable) === \App\Models\Template::class; $isDownload = $orderItem->type === \App\Enums\Item\TypeEnum::DOWNLOAD; $orderItemPreview = $orderItem?->getFirstMediaUrl('order_item_mockups') ?: $orderItem?->getFirstMediaUrl('order_item_previews'); $previewImage = match(true) { filled($orderItemPreview) && !$isDesign => $orderItemPreview, $isDesign && $itemable->linked_to_mockup => $itemable->getFirstMediaUrl('front-mockup-designs') ?: $itemable->getFirstMediaUrl('none-mockup-designs'), $isTemplate => $itemable?->getFirstMediaUrl('templates-preview'), default => $itemable?->getFirstMediaUrl( Str::plural(Str::lower(class_basename($itemable))) ), }; @endphp item photo @if($model->jobEvents->last()?->admin)

Last Operator:

Admin avatar
{{ $model->jobEvents->last()?->admin?->name }}

{{ $model->jobEvents->last()?->admin?->roles->first()?->name }}

@endif

Order ID:

{{ $model->orderItem->order->order_number }}

Go to Order

Order Item ID:

{{ $model->orderItem->id }}

Order Item Quantity:

{{ $model->orderItem->quantity }}

@if($model->orderItem->color)
Color: {{ $model->orderItem->color }}
@endif {{-- @if(--}} {{-- $model->orderItem->itemable--}} {{-- && get_class($model->orderItem->itemable) === \App\Models\Design::class--}} {{-- && $model->orderItem->itemable->linked_to_mockup--}} {{-- )--}} {{--

Mockup Positions on Design:

--}} {{-- @foreach($model->orderItem->itemable->design_mockup_area as $index => $area)--}} {{--
--}} {{--

Area {{ $index + 1 }} ({{ $area['name'] ?? 'unknown' }}):--}} {{--

--}} {{--
    --}} {{--
  • Top-Left X: {{ $area['p1x'] }}
  • --}} {{--
  • Top-Left Y: {{ $area['p1y'] }}
  • --}} {{--
  • Top-Right X: {{ $area['p2x'] }}
  • --}} {{--
  • Top-Right Y: {{ $area['p2y'] }}
  • --}} {{--
  • Bottom-Left X: {{ $area['p3x'] }}
  • --}} {{--
  • Bottom-Left Y: {{ $area['p3y'] }}
  • --}} {{--
  • Bottom-Right X: {{ $area['p4x'] }}
  • --}} {{--
  • Bottom-Right Y: {{ $area['p4y'] }}
  • --}} {{--
--}} {{--
--}} {{-- @endforeach--}} {{-- @endif--}}

@if($orderItem->itemable?->types)

Designs:

@foreach($orderItem->itemable->types as $type) @php $itemable = $orderItem->itemable; $label = $type->value->label(); $useTemplate = $isDesign && $itemable->template?->approach === 'without_editor'; $downloadUrl = ($useTemplate ? $itemable->template : $itemable)->getImageUrlForType($label); // ✅ Colored preview saved on this specific order item $coloredPreview = null; if ($orderItem->color) { $coloredPreview = $orderItem->getMedia('order_item_previews') ->first(function ($media) use ($label, $orderItem) { return strtolower((string) $media->getCustomProperty('type')) === strtolower((string) $label) && ( ! $media->hasCustomProperty('color') || strtolower((string) $media->getCustomProperty('color')) === strtolower((string) $orderItem->color) ); }) ?->getUrl(); } @endphp

{{ $label }} Design

{{ $label }} item photo {{-- Original transparent download --}} Download Design {{-- ✅ Colored download --}} @if($coloredPreview) Download with Color @endif
@endforeach
@endif
{{-- Details --}}

{{ $model->code }}


{{ $model->orderItem->orderable?->name }}

{{$model->orderItem->orderable?->description}}

Station:

{{ $model->station?->name }}

Status:

{{ $model->currentStatus?->name }}

Priority:

priority) { PriorityEnum::STANDARD => '#F8AB1B', PriorityEnum::RUSH => '#E74943', default => null, }; @endphp {{ $model->priority?->label() }}

Due Date:

{{ $model->due_at?->format("d/m/Y") }}
{{-- Codes card --}}
@if($model->station_id && $model->current_status_id)
{{-- Code128 --}} QR
{{-- Code128 --}} Code128
@endif {{-- Specifications --}} @php $specsRaw = $model->specs ?? []; // or the JSON you have $specs = is_array($specsRaw) ? $specsRaw : (json_decode($specsRaw ?? '[]', true) ?? []); @endphp @if(!empty($specs))
@foreach($specs as $row) @endforeach
Specification Option
{{ \Illuminate\Support\Str::headline((string)($row['spec_name'] ?? '')) }} {{ $row['option_name'] ?? '—' }}
@else

No specifications.

@endif
@endsection @section('vendor-script') {{-- Vendor js files --}} {{-- data table --}} @endsection @section('page-script') {{-- Page js files --}} {{-- Page js files --}} {{----}} @endsection