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::companies() ->when($this->search, fn ($q) => $q->where(function ($q) { $q->where('company_name', 'like', "%{$this->search}%") ->orWhere('email', 'like', "%{$this->search}%") ->orWhere('company_cert_number', 'like', "%{$this->search}%"); })) ->when($this->statusFilter, fn ($q) => $q->where('status', $this->statusFilter)) ->latest() ->paginate($this->perPage), 'statuses' => UserStatus::cases(), ]; } }; ?>
| {{ __('clients.company_name') }} | {{ __('clients.contact_person') }} | {{ __('clients.email') }} | {{ __('clients.registration_number') }} | {{ __('clients.status') }} | {{ __('clients.created_at') }} | {{ __('clients.actions') }} |
|---|---|---|---|---|---|---|
|
|
{{ $client->contact_person_name }} | {{ $client->email }} | {{ $client->company_cert_number }} |
@if ($client->status === UserStatus::Active)
|
{{ $client->created_at->format('Y-m-d') }} |
|
|
|
||||||