Allow fallback to "dataId" or "id" in case no attribute is found

@deprecated This custom behavior will be deprecated in futur versions

@param Request        $request
@param ParamConverter $configuration

@return string
167190
protected function getRequestAttributeName(Request $request, ParamConverter $configuration)
    {
        $param = parent::getRequestAttributeName($request, $configuration);
        if (!$request->attributes->has($param)) {
            if ($request->attributes->has('dataId')) {
                $param = 'dataId';
            } elseif ($request->attributes->has('id')) {
                $param = 'id';
            }
        }

        return $param;
    }
276726
public function show(Request $request, $id)
    {
        $this->validate($request, [
            'id' => 'uuid'
        ]);

        try{
            $did = $request->user()->dids()->where('id', $id)->with(['tags', 'client'])->firstOrFail();
            $results = fractal()->item($did, new DidTransformer());
            return response()->json($results);
        }catch (\Exception $e){
            return response()->json([ 'error' => 404, 'message' => 'Not found' ], 404);
        }

    }
375384
public function apply(Request $request, ParamConverter $configuration): void
    {
        $content = $request->getContent();

        if (!$content) {
            if ($configuration->isOptional()) {
                $request->attributes->set($configuration->getName(), null);

                return;
            }

            throw new MissingContentInRequestException();
        }

        $serializer = $this->serializerResolver->resolveByMediaType($configuration->getClass(), $request->headers->get('Content-Type'));
        $context = $this->serializationContextCollector->collect();

        $resource = $serializer->deserialize($content, $configuration->getClass(), $context);

        $request->attributes->set($configuration->getName(), $resource);
    }
10144
public function apply(Request $request, ParamConverter $configuration)
    {
        $fieldName = $this->getOptions($configuration)['type_field'];

        if ($fieldName) {
            $value = $request->attributes->get($fieldName);
            if (!$value) {
                throw new NotFoundHttpException(sprintf('Expected to have `%s` attribute present', $fieldName));
            }

            $className = $this->contentType->getContentTypeClass($value);

            if (null === $className) {
                throw new NotFoundHttpException(sprintf('Cannot guess page type from request: %s', $value));
            }

            $configuration->setClass($className);
        }

        return parent::apply($request, $configuration);
    }
380160
protected function getValue(Configuration $configuration, array $params)
  {
    if (array_key_exists(strtolower($configuration->getKey()), $params))
    {
      return $params[strtolower($configuration->getKey())];
    }
    if (array_key_exists(strtolower($configuration->getRenameTo()), $params))
    {
      return $params[strtolower($configuration->getRenameTo())];
    }

    return null;
  }
284207
protected function handleGetDefault(Request $request, $model)
    {
        $total = null;
        if (empty($request->id)) {
            if (!empty($request->filter)) {
                $model = $this->handleFilterRequest($request->filter, $model);
            }
            if (!empty($request->sort)) {
                //if sorting AND paginating, get total count before sorting!
                if ($request->pageNumber) {
                    $total = $model->count();
                }
                $model = $this->handleSortRequest($request->sort, $model);
            }
        } else {
            $model = $model->where($model->getKeyName(), '=', $request->id);
        }

        try {
            if ($request->pageNumber && empty($request->id)) {
                $results = $this->handlePaginationRequest($request, $model, $total);
            } else {
                $results = $model->get();
            }
        } catch (\Illuminate\Database\QueryException $e) {
            throw new Exception(
                'Database Request Failed',
                static::ERROR_SCOPE | static::ERROR_UNKNOWN_ID,
                BaseResponse::HTTP_INTERNAL_SERVER_ERROR,
                array('detail' => $e->getMessage())
            );
        }
        return $results;
    }
936894
protected function getResourceId(Request $request)
    {
        if ($resourceId = $request->get('viaResourceId')) {
            return $resourceId;
        };

        parse_str(parse_url($request->server->get('HTTP_REFERER'), PHP_URL_QUERY), $params);

        if ($resourceId = array_get($params, 'viaResourceId')) {
            return $resourceId;
        };

        if ($resourceId = $request->route('resourceId')) {
            return $resourceId;
        };

        return null;
    }
64060
public function determineLocale(Request $request)
    {
        return $this->hostMapping->flip()->get($request->getHost(), $this->fallback);
    }
97474
public function apply(Request $request, ParamConverter $configuration)
    {
        $slug = $request->get('slug', null);
        $username = $request->get('username', null);
        $id = $request->get('id', null);

        if ($slug)
        {
            $searchArray = array('slug' => $slug);
        }
        elseif($username)
        {
            $searchArray = array('username' => $username);
        }
        elseif($id)
        {
            $searchArray = array('id' => $id);
        }
        else
        {
            throw new \InvalidArgumentException('Route attribute is missing');
        }

        $class = $this->targetEntitiesArray[$configuration->getClass()];

        $repository = $this->doctrine->getRepository($class);

        $object = $repository->findOneBy( $searchArray );

        if(!$object)
            throw new NotFoundHttpException("Sorry, requested resource can't be found.");

        $request->attributes->set($configuration->getName(), $object);

    }
29288
protected function getObjectDataManager(Request $request)
    {
        $objectDataManager = $this->container->get(ObjectDataManager::class);
        $resolver = new OptionsResolver();
        $resolver->setDefaults([
            "folder" => null,
        ]);
        $resolver->setRequired(["returnUrl","objectId","objectType"]);
        $config = $resolver->resolve($request->get("_conf"));
        $objectDataManager->configure($config["objectId"],$config["objectType"]);
        $objectDataManager->documents()->folder($config["folder"]);
        $this->config = $config;
        return $objectDataManager;
    }
205518
private function getUserIdFromSession(Request $request): string
    {
        return $this->session->get($request, self::USER_KEY);
    }
1125711
protected function resolveDynamicFormRequestErrors(Request $request)
	{
		try {
			$config = app('itemconfig');
			$fieldFactory = app('admin_field_factory');
		} catch (\ReflectionException $e) {
			return null;
		}
		if (array_key_exists('form_request', $config->getOptions())) {
			try {
				$model = $config->getFilledDataModel($request, $fieldFactory->getEditFields(), $request->id);

				$request->merge($model->toArray());
				$formRequestClass = $config->getOption('form_request');
				app($formRequestClass);
			} catch (HttpResponseException $e) {
				//Parses the exceptions thrown by Illuminate\Foundation\Http\FormRequest
				$errorMessages = $e->getResponse()->getContent();
				$errorsArray = json_decode($errorMessages);
				if (!$errorsArray && is_string ( $errorMessages )) {
					return $errorMessages;
				}
				if ($errorsArray) {
					return implode(".", array_dot($errorsArray));
				}
			}
		}
		return null;
	}
1236112
public function getIdentifiers(
        ResourceTransformer $resourceTransformer,
        ResourceDefinition $resourceDefinition,
        Context $context,
        $request = null
    ) {
        $this->checkExists();

        /** @var InputParser $inputParser */
        foreach ($this as $inputParser) {
            $inputParser = InputParserLibrary::make($inputParser);
            $content = $inputParser->getIdentifiers($resourceTransformer, $resourceDefinition, $context, $request);

            if ($content) {
                return $content;
            }
        }

        return null;
    }
1342111
public function getConfiguration(Request $request): JsonResponse
    {
        $domain = $request->query->get('domain');

        if (!$domain) {
            throw new MissingRequestParameterException('domain');
        }

        return new JsonResponse($this->configurationService->getConfiguration($domain));
    }
865298
public function getAttribute(Request $request)
    {
        $attribute = $this->attributeRepository->find($request->get('id'));

        return view('avored-framework::product.attribute-card-values')
            ->with('attribute', $attribute);
    }
647988
public function show($id, Request $request)
    {
        $entity = $this->getEntityById($id);

        if (!$entity) {
            return $this->response(null, Response::HTTP_NOT_FOUND);
        }

        return $this->response($this->serialize($entity, $request), Response::HTTP_OK);
    }
376146
public static function getID($request)
    {
        if ($request instanceof DOMDocument) {
            $dom = $request;
        } else {
            $dom = new DOMDocument();
            $dom = OneLogin_Saml2_Utils::loadXML($dom, $request);
        }

        $id = $dom->documentElement->getAttribute('ID');
        return $id;
    }