/** * 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; }
/** * Getting listing of the all cars * @param Void * @return Json * */ public function allCarsList() { $cars = CarsModel::all(); return $cars; }
/** * Display a listing of the cars in repair * * @return \Illuminate\Http\Response * */ public function onRepair() { $cars = CarsModel::all()->whereLoose('status', 3); $admin = AdminProfile::all()->last(); return view('admin.cars.on-repair', ['cars' => $cars, 'admin' => $admin]); }