@extends('backend.layouts.master') @section('section-title', 'Product') @section('page-title', 'Product List') @if (check_permission('product.create')) @section('action-button') Add Product @endsection @endif @push('css') @endpush @section('content')
@php // $categories = App\Models\Category::get(); // $produc = App\Models\Product::get(); @endphp
Reset Print
@forelse($products as $data) @php $count_inv = App\Models\InvoiceItem::where('product_id', $data->id)->count(); $count_pur = App\Models\PurchaseItem::where('product_id', $data->id)->count(); $userBranchId = auth()->user()->branch_id; $filterBranchId = session('branch_filter_id', null); if ($userBranchId == 1) { if ($filterBranchId) { $branch_product = App\Models\BranchProduct::where( 'branch_id', $filterBranchId, ) ->where('product_id', $data->id) ->get(); } else { $branch_product = App\Models\BranchProduct::where( 'product_id', $data->id, )->get(); } } else { $branch_product = App\Models\BranchProduct::where('product_id', $data->id) ->where('branch_id', $userBranchId) ->get(); } @endphp {{-- --}} {{-- delete modal --}} @csrf {{-- @method('DELETE') --}} @empty @endforelse
#SL Branch Name Size-Color Barcode Category Cost Price Action
{{ $loop->index + 1 }} @foreach ($branch_product as $branch) {{ $branch->branch?->name }} @endforeach {{ $data->name }} @if (count($data->product_variations) > 0) @endif {{-- --}} {{ $data->barcode }} {{ $data->category?->name }}{{ $data->brand_id == null ? 'No Brand' : $data->brand->name }}{{ $data->purchase_price }} {{ $data->selling_price }}
No Data Available
{{ $products->onEachSide(1)->links() }}
@endsection @push('js') @endpush