예제 #1
0
 /**
  * Enregistre dans la bd la ressource qui vient d'être créée.
  *
  * @return Response
  */
 public function store()
 {
     try {
         $input = Input::all();
         $role = new Role();
         $role->nom = $input['nom'];
         $role->description = $input['description'];
     } catch (ModelNotFoundException $e) {
         App::abort(404);
     }
     if ($role->save()) {
         return Redirect::action('RolesController@index');
     } else {
         return Redirect::back()->withInput()->withErrors($role->validationMessages());
     }
 }