@foreach($products as $product) @endforeach
{{ __('Product Code') }} {{ __('Product Name') }} {{ __('Type') }} {{ __('Actions') }}
{{ $product->product_code }} {{ $product->product_name }} @php $typeLabels = [ 'packaged_water' => ['label' => 'Packaged Water', 'class' => 'label-primary'], 'refill_water' => ['label' => 'Refill Water', 'class' => 'label-info'], 'general' => ['label' => 'General', 'class' => 'label-default'], ]; $type = $typeLabels[$product->product_type ?? 'general'] ?? $typeLabels['general']; @endphp {{ $type['label'] }} @php $actions = [ [ 'data-replace' => '#editProduct', 'url' => '#addProductModal', 'ajax-url' => url('/Backoffice/products/'.$product->id.'/edit'), 'name' => __('Edit'), 'icon' => 'pencil' ], [ 'url' => $product->product_status === 'active' ? '/Backoffice/products/' . $product->id . '/deactivate' : '/Backoffice/products/' . $product->id . '/activate', 'name' => $product->product_status === 'active' ? __('Deactivate') : __('Activate'), 'icon' => $product->product_status === 'active' ? 'ban' : 'check' ] ]; @endphp @include('partials.actions', ['actions' => $actions])