validate([ 'name' => 'required|string|max:255', 'address' => 'nullable|string', 'phone' => 'nullable|string|max:20', ]); Hotel::create($validated); return redirect()->route('admin.hotels.index')->with('success', 'Отель успешно добавлен!'); } public function edit(Hotel $hotel) { return view('admin.hotels.edit', compact('hotel')); } public function update(Request $request, Hotel $hotel) { $validated = $request->validate([ 'name' => 'required|string|max:255', 'address' => 'nullable|string', 'phone' => 'nullable|string|max:20', ]); $hotel->update($validated); return redirect()->route('admin.hotels.index')->with('success', 'Отель успешно обновлён!'); } public function destroy(Hotel $hotel) { $hotel->delete(); return redirect()->route('admin.hotels.index')->with('success', 'Отель удалён.'); } }