app/Http/Controllers/Auth/RegisterController.php
/**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return User
     */
Create a new user instance after a valid registration.
@param  array  $data
@return User
Create a new user instance after a valid registration . @param array $data @return User
protected function create(array $data)
    {
        $user = new User();
        $user->name = $data['name'];
        $user->email = $data['email'];
        $user->password = bcrypt($data['password']);
        $user->registerType = 'Padrão';
        if(isset($data['photo'])) {
            copy($data['photo'], '/images/photos/' . $data['email'] . '.png');
            $user->photo = '/images/photos/' . $data['email'] . '.png';
        } else {
            if(isset($data['gender'])) {
                if($data['gender'] == 'male') {
                    $user->photo = '/images/male.png';
                } else {
                    $user->photo = '/images/female.png';
                }
            } else {
                $user->photo = 'images/user.png';
            }
        }
        if($user->save()) {
            $providerUser = new SocialAccountService;
            $providerUser->createSocialAccount($user);
        }    
        return $user;
    }
protected function create ( array $ data ) { $ user = new User ( ) ; $ user -> name = $ data [ 'name' ] ; $ user -> email = $ data [ 'email' ] ; $ user -> password = bcrypt ( $ data [ 'password' ] ) ; $ user -> registerType = 'Padrão'; if ( isset ( $ data [ 'photo' ] ) ) { copy ( $ data [ 'photo' ] , '/images/photos/' . $ data [ 'email' ] . '.png' ) ; $ user -> photo = '/images/photos/' . $ data [ 'email' ] . '.png' ; } else { if ( isset ( $ data [ 'gender' ] ) ) { if ( $ data [ 'gender' ] == 'male' ) { $ user -> photo = '/images/male.png' ; } else { $ user -> photo = '/images/female.png' ; } } else { $ user -> photo = 'images/user.png' ; } } if ( $ user -> save ( ) ) { $ providerUser = new SocialAccountService ; $ providerUser -> createSocialAccount ( $ user ) ; } return $ user ; }
Create a new user instance after a valid registration.
Create a new user instance after a valid registration .