/** * Execute the console command. * * @return mixed */ public function fire(Userbot $userbot, ApiMonkey $api) { $user = User::create(['char_id' => $this->argument('char_id'), 'char_name' => $api->getCharName($this->argument('char_id')), 'email' => $this->argument('email'), 'password' => Userbot::generatePassword(16), 'next_check' => \Carbon\Carbon::now('UTC')]); $userbot->updateSingle($user->char_id); $userbot->linkSlackMembers(); $user->save(); $this->info('User created and API work done.'); }
public function handleProviderCallback() { $char = Socialize::with('eveonline')->user(); try { $user = User::where('char_id', $char->id)->firstOrFail(); } catch (ModelNotFoundException $e) { $user = User::createAndFill(['char_id' => $char->id, 'char_name' => $char->name, 'password' => Userbot::generatePassword(16), 'next_check' => \Carbon\Carbon::now('UTC')]); } Auth::login($user, true); return redirect('home'); }