public function index() { $apartments = Apartment::all(); $bookings = Booking::all(); foreach ($bookings as $booking) { $booking->apartmentName = Apartment::find($booking->apartment_id)->name; } return view('admin.index', compact('apartments', 'bookings')); }
public function index() { $apartments = Apartment::all(); return view('booking.index', compact('apartments')); }