@extends('layouts.app') @section('title', 'Produk') @section('content') @php $userName = Auth::user()->name ?? 'Admin'; $nextDirFor = function ($key) use ($sort, $dir) { if ($sort !== $key) { return $key === 'name' ? 'asc' : 'desc'; } return $dir === 'asc' ? 'desc' : 'asc'; }; $sortUrl = fn ($key) => route('admin.products.index', ['sort' => $key, 'dir' => $nextDirFor($key)]); $sortIc = fn ($key) => $sort === $key ? ($dir === 'asc' ? '▲' : '▼') : '⇅'; $isSorted = fn ($key) => $sort === $key ? 'is-sorted' : ''; @endphp
Kelola produk toko Anda dengan mudah. Tambah, edit, atau hapus produk sesuai kebutuhan.
| Nama {{ $sortIc('name') }} | Harga {{ $sortIc('price') }} | Status {{ $sortIc('status') }} | Aksi |
|---|---|---|---|
|
|
Rp {{ number_format($p->price, 0, ',', '.') }} | @if($p->is_sale) Sale @elseif($p->is_new) New @else New @endif | |
| Belum ada produk. Klik "Tambah Produk" untuk menambahkan. | |||