Skip to content

Instantly share code, notes, and snippets.

@thmsbkkr
Last active June 22, 2016 19:46
Show Gist options
  • Save thmsbkkr/fa5c75d8e44394c0e69b56ba1feadf53 to your computer and use it in GitHub Desktop.
Save thmsbkkr/fa5c75d8e44394c0e69b56ba1feadf53 to your computer and use it in GitHub Desktop.
It enables multiple database connections on user registration.
/**
* 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