venue = $venue; $this->name = $venue->name; $this->city_id = $venue->city_id; $this->street = $venue->street; } public function updateVenue(): void { $validated = $this->validate([ 'name' => ['required', 'string', 'max:255', 'unique:venues,name,'.$this->venue->id], 'city_id' => ['required', 'exists:cities,id'], 'street' => ['required', 'string', 'max:255'], ]); $validated['slug'] = str($validated['name'])->slug(); $this->venue->update($validated); session()->flash('status', __('Venue successfully updated!')); $this->redirect(route_with_country('venues.index'), navigate: true); } public function with(): array { return [ 'cities' => City::query()->with('country')->orderBy('name')->get(), ]; } }; ?>