resetPage(); } public function updatedStatusFilter(): void { $this->resetPage(); } public function updatedPerPage(): void { $this->resetPage(); } public function clearFilters(): void { $this->search = ''; $this->statusFilter = ''; $this->resetPage(); } public function with(): array { return [ 'clients' => User::individual() ->when($this->search, fn ($q) => $q->where(function ($q) { $q->where('full_name', 'like', "%{$this->search}%") ->orWhere('email', 'like', "%{$this->search}%") ->orWhere('national_id', 'like', "%{$this->search}%"); })) ->when($this->statusFilter, fn ($q) => $q->where('status', $this->statusFilter)) ->latest() ->paginate($this->perPage), 'statuses' => UserStatus::cases(), ]; } }; ?>
| {{ __('clients.full_name') }} | {{ __('clients.email') }} | {{ __('clients.national_id') }} | {{ __('clients.phone') }} | {{ __('clients.status') }} | {{ __('clients.created_at') }} | {{ __('clients.actions') }} |
|---|---|---|---|---|---|---|
|
|
{{ $client->email }} | {{ $client->national_id }} | {{ $client->phone }} |
@if ($client->status === UserStatus::Active)
|
{{ $client->created_at->format('Y-m-d') }} |
|
|
|
||||||