Пример #1
0
 public function index()
 {
     $totalTrips = Trip::all()->count();
     $totalTravelCompanies = TravelCompany::all()->count();
     $totalUsers = User::all()->count();
     $totalPaidBookings = Booking::where('status', 'paid')->count();
     $totalBus = Rental::all()->count();
     return view('admin.dashboard', ['tT' => $totalTrips, 'tU' => $totalUsers, 'tP' => $totalPaidBookings, 'tC' => $totalTravelCompanies, 'tB' => $totalBus]);
 }
Пример #2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     // return all rentals
     $rentals = \App\Rental::all();
     // add the images to each rental
     foreach ($rentals as $rental) {
         $images = \App\Image::where('project_id', '=', $rental->id)->get();
         $image_response = [];
         foreach ($images as $image) {
             array_push($image_response, ['url' => config('app.url') . "/images/" . $image->id]);
         }
         $rental['images'] = $image_response;
     }
     return response()->json(['rentals' => $rentals]);
 }
Пример #3
0
 /**
  * @return $this
  */
 public function index()
 {
     $requests = Rental::all();
     //        dd($requests);
     return view('admin.rentals.index')->with('requests', $requests);
 }