public function register($code, $provider, $providerId, $email = '') { $data = ['email' => $email, 'token' => $code, 'api_key' => str_random(50), 'plan' => 0, 'provider_id' => $providerId, 'provider' => $provider]; $user = User::create($data); \Slack::send('A new user has registered.'); return $user; }
/** * Create a new user instance after a valid registration. * * @param array $data * * @return User */ public function create(array $data) { return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); }