/** * Returns account data or throw an exception. * * @param array $tokenCredentials * @return \Illuminate\Suppport\Fluent */ public static function verifyCredentials($host, array $tokenCredentials) { $instance = new static(); $instance->setHost($host); $model = $instance->newModel(); $user = $model::verifyCredentials($tokenCredentials); $instance->modifyAttributes($user); return $user; }
/** * Returns a gallery model from a specific user and api service. * * @param string $id * @param string $host * @param array $credentials * @return \Illuminate\Support\Fluent|null */ public static function find($host, $credentials, $id) { $instance = new static($host); $instance->setHost($host); $model = $instance->newModel()->setAuth($credentials)->find($id); if (!is_null($model)) { $instance->modifyAttributes($model); } return $model; }