diff --git a/app/Livewire/Admin/Client/EditClient.php b/app/Livewire/Admin/Client/EditClient.php index 3b906d7..a8ff7fe 100644 --- a/app/Livewire/Admin/Client/EditClient.php +++ b/app/Livewire/Admin/Client/EditClient.php @@ -41,7 +41,6 @@ public function edit(ClientService $clientService) $this->authorize('editClient', Auth::user()); $data = $this->clientForm->validate(); - if ($this->clientForm->profile_image_path) { $path = $this->clientForm->profile_image_path->store('client_logos', 'public'); $data['profile_image_path'] = $path; diff --git a/app/Livewire/ShowClient.php b/app/Livewire/ShowClient.php index 3565f20..ea11573 100644 --- a/app/Livewire/ShowClient.php +++ b/app/Livewire/ShowClient.php @@ -8,16 +8,33 @@ class ShowClient extends Component { + public $filters = ''; + public $clients; + + public function mount() + { + $this->clients = Client::all(); + } + + #[On('filters-added')] + + public function updatedFilters() + { + $this->clients = Client::where('name', 'LIKE', '%' . $this->filters . '%')->get(); + } #[On('client-deleted')] #[On('client-updated')] #[On('client-added')] + public function refreshClients() + { + $this->clients = Client::all(); + } + public function render() { - $clients = Client::all(); - return view('livewire.admin.show-client', [ - 'clients' => $clients + 'clients' => $this->clients ]); } } diff --git a/resources/views/livewire/admin/show-client.blade.php b/resources/views/livewire/admin/show-client.blade.php index 7561221..93c2963 100644 --- a/resources/views/livewire/admin/show-client.blade.php +++ b/resources/views/livewire/admin/show-client.blade.php @@ -1,37 +1,75 @@ -