{{ __('All Customers') }}

{{ __('Customers List') }}

{{ __('Add New Customer') }}
{{-- Session Messages --}} @if (session('success')) @endif @if (session('error')) @endif
{{-- Search Bar --}}
{{-- These hidden inputs ensure that the sorting and tab parameters are maintained during a search --}} @if (request('search')) {{ __('Clear') }} @endif
{{-- Sortable Id column --}} {{-- Sortable Name column --}} {{-- Sortable Email column --}} {{-- Sortable Phone Number column --}} {{-- Sortable Gender column (assuming 'gender' is a column in your User table) --}} {{-- Sortable Status column (assuming 'active' is a column in your User table) --}} @forelse ($customers as $customer) @empty @endforelse
{{ __('Id') }} @if (request('sort_by') === 'id') @else @endif {{ __('Name') }} @if (request('sort_by') === 'name') @else @endif {{ __('Email') }} @if (request('sort_by') === 'email') @else @endif {{ __('Phone Number') }} @if (request('sort_by') === 'phone_number') @else @endif {{ __('Gender') }} @if (request('sort_by') === 'gender') @else @endif {{ __('Status') }} @if (request('sort_by') === 'active') @else @endif {{ __('Action') }}
{{ $customer->id }} {{ $customer->name }} {{ $customer->email }} {{ $customer->phone_number ?? 'N/A' }} {{ $customer->gender ?? 'N/A' }}
@csrf @method('PATCH')
{{-- Hide the edit button if the customer is a super admin --}} @unless ($customer->is_super_admin) @endunless {{-- This conditional statement hides the delete button based on the logged-in user's ID and the user's super admin status --}} @unless (auth()->id() === $customer->id || $customer->is_super_admin) @endunless
{{ __('No customers found.') }}
{{-- Pagination --}}
{{ $customers->links() }}
@csrf @method('DELETE')
{{-- Custom CSS for toggle switch --}}