@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])
@endforeach
{{ __('dashboard.All Suppliers') }}
{{ number_format($suppliers->total()) }}
@if($suppliers->isEmpty())
@include('layouts.partials.index-empty-state',['icon'=>'fa-solid fa-users','title'=>__('dashboard.No suppliers found.'),'message'=>''])
@else
@foreach(['#','المورد','الهاتف','العنوان',''] as $h)
| {{ $h }} |
@endforeach
@foreach($suppliers as $s)
| {{ $s->id }} |
{{ mb_substr($s->name,0,1) }}
{{ $s->name }}
|
@if($s->phone)
@else
—
@endif
|
{{ $s->address ?: '—' }} |
@canany(['view suppliers','edit suppliers','delete suppliers'])
@endcanany
|
@endforeach
{{ $suppliers->appends(request()->query())->links() }}
@endif
@endsection