country = request()->route('country', config('app.domain_country')); } public function createVenue(): void { $validated = $this->validate([ 'name' => ['required', 'string', 'max:255', 'unique:venues,name'], 'city_id' => ['required', 'exists:cities,id'], 'street' => ['required', 'string', 'max:255'], ]); $validated['slug'] = str($validated['name'])->slug(); $validated['created_by'] = auth()->id(); $venue = Venue::create($validated); session()->flash('status', __('Venue successfully created!')); $this->redirect(route_with_country('venues.index'), navigate: true); } public function with(): array { return [ 'cities' => City::query() ->with('country') ->whereHas('country', fn($query) => $query->where('countries.code', $this->country)) ->orderBy('name')->get(), ]; } }; ?>