예제 #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     //
     $input = Input::all();
     $validation = Validator::make($input, Community::$rules);
     if ($validation->passes()) {
         $community = Community::find($id);
         $community->update($input);
         Session::flash('message', 'Community is updated!');
         Session::flash('alert-class', 'alert-success');
         return Redirect::route('community.show', $id);
         //was community.show
     }
     return Redirect::route('community.edit', $id)->withInput()->withErrors($validation)->with('message', 'There were validation errors.');
 }