/** * Store a newly created staff in storage. * * @return \Response */ public function store() { $validator = \Validator::make($data = \Input::all(), User::$rules); if ($validator->fails()) { return \Redirect::back()->withErrors($validator)->withInput(); } User::create($data); return \Redirect::route('staffs.index'); }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { return User::create(['username' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); }