/** * Show the form for editing the specified resource. * * @param App\RoomType $roomType * @return Response */ public function edit(RoomType $roomType) { $facilities = Facility::orderBy('name', 'asc')->get(); $room_facilities = $roomType->facilities()->lists('facility_id'); return view('type.edit', compact('roomType', 'facilities', 'room_facilities')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $facilities = Facility::orderBy('name', 'asc')->with('roomTypes')->paginate(10); return view('facility.index', compact('facilities')); }