@extends('layouts.admin') @section('title', 'Produk') @section('content') @php $breadcrumbs = [ ['label' => 'Dashboard', 'url' => route('admin.dashboard')], ['label' => 'Master', 'url' => '#'], ['label' => 'Produk Jasa', 'url' => route('admin.master.products.index')] ]; @endphp

Daftar Jasa

@if (request('search')) @endif
Tambah Jasa
@if (request('search') || request('category') || request()->has('status'))
Filter Aktif: @if (request('search')) Pencarian: "{{ request('search') }}" @endif @if (request('category')) @php $selectedCategory = $parentCategories->firstWhere('id', request('category')) ?? $childCategories->firstWhere('id', request('category')); @endphp Kategori: {{ $selectedCategory ? $selectedCategory->name : 'Unknown' }} @endif @if (request()->has('status')) Status: {{ request('status') == '1' ? 'Aktif' : 'Nonaktif' }} @endif
@endif
@forelse ($products as $product) @empty @endforelse
No Gambar Nama Jasa Kategori Harga Materials Spareparts Status Aksi
{{ $loop->iteration + $products->firstItem() - 1 }}
@if ($product->product_image) Gambar Produk @elseif ($product->images && $product->images->count() > 0) Gambar Produk @else
@endif @php $totalImages = ($product->product_image ? 1 : 0) + ($product->images ? $product->images->count() : 0); @endphp @if ($totalImages > 1) {{ $totalImages }} @endif
{{ $product->product_title }} @php $mismatchedCount = ($product->productions ?? collect())->filter(function($production) use ($product) { return $production->labor_cost && $production->labor_cost != ($product->service_fee ?? 0); })->count(); @endphp @if($mismatchedCount > 0) {{ $mismatchedCount }} @endif
{{ $product->category_name }} Rp {{ number_format($product->product_prices, 0, ',', '.') }} @if ($product->materials && $product->materials->count() > 0) {{ $product->materials->count() }} bahan @else - @endif @if ($product->spareparts && $product->spareparts->count() > 0) {{ $product->spareparts->count() }} sparepart @else - @endif @if ($product->is_active) Aktif @else Nonaktif @endif
{{-- Pagination (Inside Container, Tipis) --}} @if ($products->hasPages())
{{-- Info --}}
Menampilkan {{ $products->firstItem() }}{{ $products->lastItem() }} dari {{ $products->total() }} data
{{-- Pagination --}}
{{ $products->onEachSide(1)->links() }}
@endif
@endsection