@extends('admin.master') @section('title','Product List') @section('content')
@if(auth()->user()->role_id == 1) CSV import @endif Add Product
@yield('title')
@if(session()->has('success'))
 {{ session()->get('success') }}
@endif @if(session()->has('error'))
 {{ session()->get('error') }}
@endif
{!! $sl=null !!} @foreach($data AS $value) {{-- Warranty status fixed (Checking 1 instead of yes) --}} @endforeach
S/L Name Code Brand Category Warranty Cost Retail price Wholesale Price Quantity Action
{!! ++$sl !!} {!! $value->name !!} {!! $value->code !!} {{ $value->brandObj ? $value->brandObj->title : '' }} @if(isset($value->category)){!! $value->category->name !!}@endif @if($value->warranty_status == 1) Yes @else No @endif {!! $value->product_cost !!} {!! $value->retail_price !!} {!! $value->wholesale_price !!} @php $totalQty = 0; @endphp @if(isset($value->stock_qty)) @foreach($value->stock_qty as $qty) @php $totalQty += $qty->quantity; @endphp @endforeach @endif {{-- Stock Alert Logic --}} {{ $totalQty }} @if(auth()->user()->role_id == 1) @endif
@endsection @section('page_scripts') @endsection