clientId = $clientId; $client = Client::findOrFail($clientId); $this->name = $client->name; $this->abbreviation = $client->abbreviation; $this->audition_date = $client->audition_date?->format('Y-m-d'); $this->resetValidation(); Flux::modal('edit-client')->show(); } public function save(): void { $this->validate([ 'name' => 'required|string|max:255|unique:clients,name,' . $this->clientId, 'abbreviation' => 'required|string|max:10|unique:clients,abbreviation,' . $this->clientId, 'audition_date' => 'nullable|date|after_or_equal:today', ]); $client = Client::findOrFail($this->clientId); $client->update([ 'name' => $this->name, 'abbreviation' => $this->abbreviation, 'audition_date' => $this->audition_date ?: null, ]); $this->reset(); Flux::modal('edit-client')->close(); $this->dispatch('client-updated'); } }; ?>