Exemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     //
     $input = Input::all();
     $validation = Validator::make($input, Community::$rules);
     if ($validation->passes()) {
         Community::create($input);
         Session::flash('message', 'A new Community is saved!');
         Session::flash('alert-class', 'alert-success');
         return Redirect::route('community.index');
     }
     return Redirect::route('community.create')->withInput()->withErrors($validation)->with('message', 'There were validation errors.');
 }