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]); }
/** * Returns random Trips with featured image filename, if there are less than the required trips available, it will return everything there is * * @param $amount * @return mixed */ public static function getRandomTrips($amount) { $tripsAll = Trip::all(); $count = $tripsAll->count(); if ($count < $amount) { $amount = $count; } $trips = $tripsAll->random($amount)->shuffle(); foreach ($trips as $trip) { if ($pic = $trip->getFeaturedImage()) { $trip->picName = $pic->filename; } } return $trips; }
public function getIndex() { return view('schedule')->with('schedules', Trip::all()); // TODO: lazy loading! }
public function getAdminTrips() { $trips = Trip::all(); $bookings = Booking::all(); return view('adminOverview', ['trips' => $trips, 'bookings' => $bookings]); }
public function getTrips() { $trips = Trip::all(); return view('startpage', ['trips' => $trips]); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $trips = Trip::all(); return view('trips.index', compact('trips')); }
/** * @return \Illuminate\View\View */ public function all_trips() { $allTrips = Trip::all(); $travel_companies = TravelCompany::all(); return view('pages.all_trips', ['trips' => $allTrips, 'travel_companies' => $travel_companies]); }
public function home() { $trips = Trip::all(); $routes = Route::all(); return view('home', compact('trips', 'routes')); }