@extends('layouts.app') @section('title', 'Clients') @section('content') @php $pills = filter_pills([ 'status' => ['Status', ['active' => 'Active', 'inactive' => 'Inactive']], 'city' => ['City'], 'country' => ['Country', fn ($c) => \App\Support\Countries::name($c)], 'balance' => ['Balance', ['owing' => 'Owes money']], ]); $chips = [[null, 'All', $counts['all']], ['active', 'Active', $counts['active']], ['inactive', 'Inactive', $counts['inactive']]]; $filtered = count($pills) > 0 || request()->filled('q'); @endphp @can('data.export') Export @endcan @can('clients.create') Add client @endcan
@foreach ($chips as [$key, $label, $n]) {{ $label }} {{ $n }} @endforeach Owes money {{ $counts['owing'] }}
@forelse ($clients as $c) @empty @endforelse
Contact Actions
{{ $c->name }} @unless ($c->is_active)Inactive@endunless @if ($c->email){{ $c->email }}@endif
{{ $c->contact_person ?: '—' }}{{ $c->phone }} {{ $c->city ?: ($c->countryName() ?: '—') }}@if ($c->city && $c->countryName()){{ $c->countryName() }}@endif {{ money($c->billed()) }} {{ money($c->received()) }} {{ money($c->balance()) }} @if ($c->credit_limit > 0 && $c->balance() > $c->credit_limit)over credit limit@endif
  • View
  • @can('clients.edit')
  • Edit
  • @endcan @can('orders.create')
  • New order
  • @endcan @can('payments.create')
  • Receive payment
  • @endcan @can('clients.delete')
  • @endcan
    @can('clients.create') Add your first client @endcan
    @endsection