Esempio n. 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]);
 }
Esempio n. 2
0
 /**
  * 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;
 }
Esempio n. 3
0
 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]);
 }
Esempio n. 5
0
 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'));
 }
Esempio n. 7
0
 /**
  * @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]);
 }
Esempio n. 8
0
 public function home()
 {
     $trips = Trip::all();
     $routes = Route::all();
     return view('home', compact('trips', 'routes'));
 }