public function view($type) { if (Auth::check()) { $cars = Car::all(); if ($type == "open") { $sectionArray = array('Open'); $rentals = Rental::where('state', 0)->where('user_id', Auth::user()->id)->get(); if ($rentals->count()) { //not empty $empty = false; } else { $empty = true; } } else { $sectionArray = array('Closed'); $rentals = Rental::where('state', 1)->where('user_id', Auth::user()->id)->get(); if ($rentals->count()) { //not empty $empty = false; } else { $empty = true; } } return view('history.rentals', compact('rentals', 'cars', 'sectionArray'))->with('empty', $empty); } else { return Redirect::to('/'); } }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $guns = Gun::all(); $armors = Armor::all(); $cars = Car::all(); return view('shop.shop', compact('guns', 'armors', 'cars')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // //dd($this->User()->id); $cars = array(); $models = array(); $car = Car::all(); $title = "Ajout Disponibilité"; foreach ($car as $c) { $cars[$c->id] = $c->model; } $model = Modele::all(); foreach ($model as $m) { $models[$m->id] = $m->name; } $date = \Carbon\Carbon::today(); $date = $date->format('Y-m-d'); return view('TestDrives/disponibility-test-drive', ['title' => $title, 'cars' => $cars, 'date' => $date, 'models' => $models]); }
public function index() { if (Auth::check()) { //get all cars $cars = Car::all(); $sectionArray = array(); $luxCounter = 0; $stanCounter = 0; $comCounter = 0; foreach ($cars as $car => $key) { if ($key->type == "Luxury") { $luxCounter++; } else { if ($key->type == "Standard") { $stanCounter++; } else { if ($key->type == "Compact") { $comCounter++; } } } } if ($luxCounter > 0) { array_push($sectionArray, "Luxury"); } if ($stanCounter > 0) { array_push($sectionArray, "Standard"); } if ($comCounter > 0) { array_push($sectionArray, "Compact"); } return view('rental.index', compact('cars', 'sectionArray')); } else { return Redirect::to('/'); } }
public function index() { $cars = Car::all(); return view('cars.index', ['cars' => $cars]); }
public function show_devis() { $title = 'Devis'; $quotations = Quotation::all(); $cars = Car::all(); $customers = Customer::all(); /* return view('Mail/mail_devis',[ 'finition'=>$request->finition, 'basic_price'=>$request->basic_price, 'tva'=>$request->tva, 'frais_imm'=>$request->frais_imm, 'tme'=>$request->tme, 'frais_timbre'=>$request->frais_timbre, 'prix_tot'=>$request->prix_total_voiture, 'options'=>$options, 'prix_options'=>$request->prix_options, 'name'=>$customer->name, 'last_name'=>$customer->last_name, 'datetime'=>$datetime] );*/ }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $cars = Car::all(); return view('cars.index', ['cars' => $cars, 'count' => Car::count()]); }
/** * Display list cars. * */ public function listcars() { $title = "List des voitures"; $cars = Car::all(); return view('Cars/list-cars', ['title' => $title, 'cars' => $cars]); }
/** * Display a listing of the resource. * * @return Response */ public function index() { return view('cars.index')->with('cars', Car::all()); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $cars = Car::all(); return view('car.index', compact('cars')); }
/** * --------------------------------- * Show All Cars * --------------------------------- * URL : /cars * * @return mixed * */ public function index() { return Car::all(); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $items = Car::all(); return view('admin.cars.index', compact('items')); }