Ejemplo 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]);
 }
Ejemplo 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;
 }
Ejemplo n.º 3
0
 public function getIndex()
 {
     return view('schedule')->with('schedules', Trip::all());
     // TODO: lazy loading!
 }
Ejemplo n.º 4
0
 public function getAdminTrips()
 {
     $trips = Trip::all();
     $bookings = Booking::all();
     return view('adminOverview', ['trips' => $trips, 'bookings' => $bookings]);
 }
Ejemplo n.º 5
0
 public function getTrips()
 {
     $trips = Trip::all();
     return view('startpage', ['trips' => $trips]);
 }
Ejemplo n.º 6
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $trips = Trip::all();
     return view('trips.index', compact('trips'));
 }
Ejemplo 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]);
 }
Ejemplo n.º 8
0
 public function home()
 {
     $trips = Trip::all();
     $routes = Route::all();
     return view('home', compact('trips', 'routes'));
 }