public function getList() { $vehicules = Vehicule::all(); $membres = User::all(); $modeles = Modele::all(); $types = Type::all(); return view('backoffice.vehicules', compact("vehicules", "membres", "modeles", "types")); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $types = Type::all(); $marques = Marque::all(); $modeles = Modele::all(); $couleurs = Couleur::all(); $vehicule = Vehicule::find($id); $idMarque = DB::table('modele')->join('marque', 'marque.marque_id', '=', 'modele.marque_id')->select('marque.marque_id')->where('modele.modele_id', $vehicule->modele_id)->get()[0]->marque_id; $idType = DB::table('marque')->join('type', 'type.type_id', '=', 'marque.type_id')->select('type.type_id')->where('marque.marque_id', $idMarque)->get()[0]->type_id; return view('dashboard.profile.vehicule.edit_car', ['types' => $types, 'marques' => $marques, 'marqueCourante' => $idMarque, 'modeles' => $modeles, 'typeCourant' => $idType, 'couleurs' => $couleurs, 'vehicule' => $vehicule]); }
/** * 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 add(Request $request) { $modele = Modele::create(['nomMod' => $request->input('nomMod'), 'idMarq' => $request->input('idMarq')]); $modele->save(); return redirect()->route('backModel'); }
public function getFinition($id) { $list_car = array(); $cars = array(); $model = Modele::findOrFail($id); $list_car = $model->cars()->get(); foreach ($list_car as $car) { $cars[$car->id] = $car->finition; } return json_encode($cars); }
/** * Run the database seeds. * * @return void */ public function run() { Modele::create(['idMod' => 1, 'nomMod' => 'clio', 'idMarq' => 1]); Modele::create(['idMod' => 2, 'nomMod' => 'Fazer', 'idMarq' => 2]); }
public function frontIndex() { $title = 'Audi front'; // $cars=array(); $modele = Modele::all(); /* dd($car); foreach ($car as $c) { $cars[$c->id] = $c->model; } */ return view('Front.front', ['title' => $title, 'modele' => $modele]); }