get(); return view('admin.locations.index', compact('locations')); } public function store(Request $request): RedirectResponse { $validated = $request->validate([ 'name' => ['required', 'string', 'max:255'], 'address_text' => ['nullable', 'string', 'max:500'], 'location_lat' => ['nullable', 'numeric', 'between:-90,90'], 'location_lng' => ['nullable', 'numeric', 'between:-180,180'], ]); Location::create($validated); return redirect()->route('admin.locations.index') ->with('success', __('admin.location_created')); } public function update(Request $request, Location $location): RedirectResponse { $validated = $request->validate([ 'name' => ['required', 'string', 'max:255'], 'address_text' => ['nullable', 'string', 'max:500'], 'location_lat' => ['nullable', 'numeric', 'between:-90,90'], 'location_lng' => ['nullable', 'numeric', 'between:-180,180'], ]); $location->update($validated); return redirect()->route('admin.locations.index') ->with('success', __('admin.location_updated')); } public function destroy(Location $location): RedirectResponse { $location->delete(); return redirect()->route('admin.locations.index') ->with('success', __('admin.location_deleted')); } }