/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $artistes = Artiste::all(); $concerts = Concert::paginate(9); $villes = Concert::distinct()->select('Ville')->get(); $tags = Artiste::distinct()->select('Tags')->get(); return view('index', compact('artistes', 'villes', 'tags')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $mode = true; $concert = Concert::findOrFail($id); $myDateTime = DateTime::createFromFormat('Y-m-d H:i:s', $concert->Date); $dateString = $myDateTime->format('Y-m-d'); $timeString = $myDateTime->format('H:i'); $artistes = Artiste::distinct()->select('Nom')->get(); $lieu = Concert::distinct()->select('Lieu')->get(); return view('createOrUpdate', compact('mode', 'lieu', 'artistes', 'concert', 'dateString', 'timeString')); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show(Request $request) { $id_concert = (int) $request->get('concert'); $id_artiste = (int) $request->get('artiste'); $concert = Concert::find($id_concert); $artiste = Artiste::find($id_artiste); return view('homepage.detail-concert', ['concert' => $concert, 'artiste' => $artiste]); }