Last active
June 22, 2016 19:46
-
-
Save thmsbkkr/fa5c75d8e44394c0e69b56ba1feadf53 to your computer and use it in GitHub Desktop.
It enables multiple database connections on user registration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create a new user instance after a valid registration. | |
* | |
* @param array $data | |
* @return User | |
*/ | |
protected function create($connection, array $data) | |
{ | |
$user = new User(); | |
$user->setConnection($connection); | |
$user->fill([ | |
'name' => $data['name'], | |
'email' => $data['email'], | |
'password' => bcrypt($data['password']), | |
]); | |
$user->save(); | |
return $user; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment