Example #1
0
 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'));
 }
Example #2
0
 public function index()
 {
     $apartments = Apartment::all();
     return view('booking.index', compact('apartments'));
 }