/**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateUserRequest $request)
 {
     if ($request->all()) {
         User::create(['user_name' => Input::get('user_name'), 'email_address' => Input::get('email_address'), 'password' => Hash::make(Input::get('password')), 'first_name' => Input::get('first_name'), 'last_name' => Input::get('last_name'), 'gender' => intval(Input::get('gender')), 'country' => Input::get('country'), 'birth_date' => date('y-m-d', strtotime(Input::get('birth_date')))]);
         $request->session()->put('user', User::where('email_address', Input::get('email_address'))->first()->toArray());
         return redirect('user');
     }
     dd("ALALALH!@");
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateUserRequest $request)
 {
     if ($request->all()) {
         $aUser = User::create(['user_name' => Input::get('user_name'), 'email_address' => Input::get('email_address'), 'password' => Hash::make(Input::get('password')), 'first_name' => Input::get('first_name'), 'last_name' => Input::get('last_name'), 'gender' => intval(Input::get('gender')), 'country' => Input::get('country'), 'birth_date' => date('y-m-d', strtotime(Input::get('birth_date'))), 'avatar' => Photo::PHOTO_LINK_AVATAR_USER_DEFAULT]);
         $aCharacter = Character::create(['user_id' => $aUser['id'], 'families_id' => 1, 'character_name' => $aUser['user_name'], 'character_age' => 1, 'character_avatar' => Photo::PHOTO_LINK_AVATAR_CHARACTER_NORMAL_DEFAULT, 'character_avatar_mini' => Photo::PHOTO_LINK_AVATAR_CHARACTER_MINI_DEFAULT]);
         $aUser->update(['current_character_id' => $aCharacter['id']]);
         $request->session()->put('user', User::where('email_address', Input::get('email_address'))->first()->toArray());
         UserSetting::create(['user_id' => User::where('email_address', Input::get('email_address'))->first()->toArray()['id']]);
         return redirect('user/profile');
     }
     dd("ALALALH!@");
 }
예제 #3
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateUserRequest $request)
 {
     //validation
     $user = new User();
     $user->name = $request->input('name');
     $user->email = $request->input('email');
     $user->username = $request->input('username');
     $password = Hash::make($request->input('password'));
     $user->password = $password;
     $user->college = $request->input('college');
     $user->save();
     $request->session()->flash('username', $user->username);
     return view('login');
 }
예제 #4
0
 public function store(\App\Http\Requests\CreateUserRequest $request)
 {
     // create the user
     $user = $this->user->create($request->all());
     // sync the roles if the user provided for one
     if ($request->get('roles')) {
         $user->roles()->sync($request->get('roles'));
     } else {
         $user->roles()->sync([]);
     }
     // flash successfull message
     $request->session()->flash('success', 'Successfully create user');
     // return back to previous
     return back();
 }