Ejemplo n.º 1
0
 /**
  * @return \Illuminate\View\View
  */
 public function dashboard()
 {
     $company_id = Auth::travel_company_staff()->get()->travel_company->id;
     $number_of_trips = Trip::whereraw('travel_company_id = ?', [$company_id])->count();
     $number_of_stations = Station::whereraw('travel_company_id = ?', [$company_id])->count();
     $number_of_paid_bookings = Booking::whereraw('travel_company_id = ? AND status = ?', [$company_id, 'paid'])->count();
     $number_of_travel_bookings = Booking::whereraw('travel_company_id = ? AND status = ? AND updated_at > ?', [$company_id, 'paid', Carbon::today()])->count();
     return view('companies.account.dashboard', ['number_of_trips' => $number_of_trips, 'number_of_stations' => $number_of_stations, 'number_of_paid_bookings' => $number_of_paid_bookings, 'number_of_travel_bookings' => $number_of_travel_bookings]);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $company_id = Auth::travel_company_staff()->get()->travel_company->id;
     $stations = Station::whereraw('travel_company_id = ?', [$company_id])->orderBy('created_at', 'desc')->get();
     return view('companies.stations.index')->with('stations', $stations);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param Station $station
  *
  * @param Trip $trip
  *
  * @internal param int $id
  * @return Response
  */
 public function edit(Trip $trip)
 {
     $company = Auth::travel_company_staff()->get()->travel_company;
     $stations = Station::whereraw('travel_company_id = ?', [$company->id])->get();
     return view('companies.trips.edit', ['stations' => $stations, 'trip' => $trip]);
 }