Ejemplo n.º 1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(StoreRegion $request, $id)
 {
     try {
         $region = Region::findOrFail($id);
     } catch (ModelNotFoundException $e) {
         abort(404);
     }
     $region->update($request->all());
     $region->save();
     return redirect('regions')->with('alert-success', 'Регион обновлен');
 }
 /**
  * Affiche la ressource.
  *
  * @param  int  $id l'id du terrain à afficher
  * @return Response
  */
 public function show($id)
 {
     try {
         $terrain = Terrain::findOrFail($id);
         $region = Region::findOrFail($terrain->region_id);
         $terrainSports = Terrain::find($id)->sports;
         $sports = Sport::all();
         if ($terrain->description_courte === "") {
             $terrain->description_courte = "Aucune description";
         }
         return View::make('terrains.show', compact('terrain', 'region', 'sports', 'terrainSports'));
     } catch (Exception $e) {
         App::abort(404);
     }
 }
 /**
  * Affiche la ressource.
  *
  * @param  int  $id l'id du rôle à afficher
  * @return Response
  */
 public function show($id)
 {
     try {
         $delegue = Delegue::findOrFail($id);
         $region = Region::findOrFail($delegue->region_id);
     } catch (ModelNotFoundException $e) {
         App::abort(404);
     }
     return View::make('delegues.show', compact('delegue', 'region'));
 }