/** * @param string $hash * @return UserModel */ public function getByHash($hash) { if ($hash instanceof UserModel) { return $hash; } return parent::getByHash($hash); }
/** * @param $key * @param $value * @param Repository $transform * @return \stdClass */ protected function transformByRepository($key, $value, EloquentRepository $transform) { try { $value = $transform->getByHash($value); $this->keys[$key] = $value; } catch (NotFoundModelException $e) { throw new BadRequestHttpException("{$value} not found."); } return $value; }