public function oauth2Login($user, $pass) { $host = Host::whereRaw('username = ?', [$user])->select('id', 'password')->first(); $valid = $this->hash->isValid($pass, $host['password']); if ($valid === true) { return $host['id']; } else { return false; } }