@extends('layouts.app') @section('title', __('dashboard.sidebar_suppliers')) @section('page_heading', __('dashboard.sidebar_suppliers')) @section('content') {{-- KPIs --}}
@foreach([ ['fa-solid fa-users', '#eff6ff','#2563eb', $suppliers->total(), __('dashboard.total_suppliers')], ['fa-solid fa-truck', '#f0fdf4','#16a34a', \App\Models\Purchase::distinct('supplier_id')->count('supplier_id'), __('dashboard.suppliers_with_purchases')], ['fa-solid fa-coins', '#fffbeb','#d97706', number_format(\App\Models\Purchase::sum('final_total'),2), __('dashboard.total_purchases_stat')], ] as [$ic,$bg,$cl,$val,$lbl])
{{ $val }}
{{ $lbl }}
@endforeach
{{ __('dashboard.All Suppliers') }} {{ number_format($suppliers->total()) }}
@can('create suppliers') {{ __('dashboard.Add New Supplier') }} @endcan
@if($suppliers->isEmpty())
@include('layouts.partials.index-empty-state',['icon'=>'fa-solid fa-users','title'=>__('dashboard.No suppliers found.'),'message'=>''])
@else
@foreach(['#','المورد','الهاتف','العنوان',''] as $h) @endforeach @foreach($suppliers as $s) @endforeach
{{ $h }}
{{ $s->id }}
{{ mb_substr($s->name,0,1) }}
{{ $s->name }}
@if($s->phone)
{{ $s->phone }}
@else @endif
{{ $s->address ?: '—' }} @canany(['view suppliers','edit suppliers','delete suppliers'])
@can('view suppliers')عرض@endcan @can('edit suppliers')تعديل@endcan @can('delete suppliers')
@csrf @method('DELETE')
@endcan
@endcanany
{{ $suppliers->appends(request()->query())->links() }}
@endif
@endsection