コード例 #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::get();
     $v = $this->validate($input);
     if ($v->passes()) {
         unset($input['_token']);
         Sales::create(Input::get());
         return Redirect::to('sales')->with('message', trans('data.success_saved'));
     } else {
         return Redirect::back()->withInput()->withErrors($v)->with('message', trans('data.error_saving'));
     }
 }