/**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     /*
      * car data
      * */
     $car = new CarsModel();
     $carsAll = $car->allCarsList();
     /*
      * Extra Data
      * */
     $extra = new ExtraModel();
     $extraAll = $extra->allExtradata();
     /*
      * PriceData
      * */
     $price = new PriceModel();
     $threePricePanels = $price->firstThreePricePanel();
     //Return view with data
     return view('site.index', ['cars' => $carsAll, 'extra' => $extraAll, 'threePricePanel' => $threePricePanels]);
 }
 /**
  * Display a listing of the resource.
  * return the data for graph
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $carbon = Carbon::now();
     $admin = AdminProfile::all()->last();
     /*Cars Model On Service Graph*/
     $carsLuxary = CarsModel::all()->where('status', '2')->where('class', '1')->count();
     $carsMiddle = CarsModel::all()->where('status', '2')->where('class', '2')->count();
     $carsComfort = CarsModel::all()->where('status', '2')->where('class', '3')->count();
     /*Price Plan Most Popular*/
     $pricePlan1 = BookingsModel::all()->where('price_plan', '1')->count();
     $pricePlan2 = BookingsModel::all()->where('price_plan', '2')->count();
     $pricePlan3 = BookingsModel::all()->where('price_plan', '3')->count();
     /*Bookings  Status*/
     $completed = BookingsModel::all()->where('status', '1')->where('receive_date', $carbon->subMonth())->count();
     $onGoing = BookingsModel::all()->where('status', '2')->where('receive_date', $carbon->subMonth())->count();
     $upComing = BookingsModel::all()->where('status', '3')->where('receive_date', $carbon->subMonth())->count();
     return view('partials/index', ['admin' => $admin, 'carsLuxary' => $carsLuxary, 'carsMiddle' => $carsMiddle, 'carsComfort' => $carsComfort, 'pricePlan1' => $pricePlan1, 'pricePlan2' => $pricePlan2, 'pricePlan3' => $pricePlan3, 'carbon' => $carbon, 'completed' => $completed, 'onGoing' => $onGoing, 'upComing' => $upComing]);
 }
 public function carRentedMost()
 {
     $cars = CarsModel::all();
     $carsData = $cars['class']->where('status', 1);
     return $carsData;
 }
Example #4
0
 /**
  *  Getting listing of the all cars
  *  @param Void
  *  @return Json
  * */
 public function allCarsList()
 {
     $cars = CarsModel::all();
     return $cars;
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     //
     $car = CarsModel::find($id);
     $car->delete();
     // Session::flash('message' , 'Deleted Successfully');
     return Redirect::to("admin/cars");
 }
Example #6
0
 /**
  *  Display a listing of the cars data
  *  @return Json
  * */
 public function carsApi(CarsModel $cars)
 {
     $carsList = $cars->allCarsList();
     return response()->json($carsList);
 }