public function run() { $user = new User(); $user->firstname = 'andrian'; $user->lastname = 'martiyanto'; $user->email = '*****@*****.**'; $user->password = Hash::make('641987'); $user->telephone = '085727344444'; $user->admin = 1; $user->save(); }
public function postCreate() { $validator = Validator::make(Input::all(), User::$rules); if ($validator->passes()) { $user = new User(); $user->firstname = Input::get('firstname'); $user->lastname = Input::get('lastname'); $user->email = Input::get('email'); $user->password = Hash::make(Input::get('password')); $user->telephone = Input::get('telephone'); $user->save(); return Redirect::to('users/signin')->with('message', 'Thank you for creating a new account, Please sign in'); } return Redirect::to('users/newaccount')->with('message', 'Something went wrong')->withErrors($validator)->withInput(); }