Allow repeaters on this resource if available

@param Request $request
@return mixed
514392
public function morphRepeaters(Request $request)
    {
        if (!$this->repeaterHasSubTypes($request)) {
            return $this->merge([]);
        }

        return $this->merge([
            MorphMany::make(__('Repeaters'), 'repeaters', Repeater::class),
        ]);
    }
531824
public static function toUriString(Request $request)
    {
        $uri = clone $request->getUri();

        $uri->setQuery(array_merge($uri->getQueryAsArray(),
            $request->getQuery()->toArray()));

        return $uri->toString();
    }
439654
protected function parseRouteRequest (Request $request)
		{
			$routeString = preg_replace('#(^' . preg_quote(rtrim($this->getBaseUri($request), '/'), '#') . ')#', '', $request->getUri(false));
			$routeString = strtok($routeString, '#?');
			$routeString = trim($routeString, '/');

			$parsed = parent::parseRouteRequest($request);

			if (
				! in_array($parsed['method'], array('index', 'get', 'insert', 'update', 'delete'))
				&& $this->getController($request)->respondsTo($parsed['method'])
			) {
				return $parsed;

			} else if ($request->getMethod() == 'GET' && preg_match('#^[^/][^/]*$#', $routeString)) {
				return array(
					'method' => 'get',
					'arguments' => array_filter(explode('/', $routeString)),
				);

			} else if ($request->getMethod() == 'GET' && $routeString == '') {
				return array(
					'method'    => 'index',
					'arguments' => array()
				);

			} else if ($request->getMethod() == 'DELETE' && preg_match('#^[^/][^/]*$#', $routeString)) {
				return array(
					'method'    => 'delete',
					'arguments' => array_filter(explode('/', $routeString)),
				);

			} else if ($request->getMethod() == 'POST' && preg_match('#^[^/][^/]*$#', $routeString)) {
				return array(
					'method'    => 'update',
					'arguments' => array_filter(explode('/', $routeString)),
				);

			} else if ($request->getMethod() == 'POST' && $routeString == '') {
				return array(
					'method'    => 'insert',
					'arguments' => array()
				);

			} else {
				if (in_array($parsed['method'], array('index', 'get', 'insert', 'update', 'delete'))) {
					$parsed['method'] = ' non-existent method ';
				}

				return $parsed;
			}
		}
167230
public function moveDown(Request $request)
    {
        // AUTHORIZE ... COMES HERE
        $pageblock = $this->pageBlockRepository->moveDownById($request->get('pageblock_id'));
        return $pageblock;
    }
461169
public function matchRequest(Request $request)
    {
        try {
            $parameters = parent::matchRequest($request);
            $this->matchedRouteRequest = $request;
            return $parameters;
        } catch (\Exception $e) {
            throw $e;
        }


    }
374494
public function getByUri(Request $request)
    {
        if (!$request->headers->has('X-Islandora-URI')) {
            return new Response('Require the X-Islandora-URI header', 400);
        }
        $uri = $request->headers->get('X-Islandora-URI');
        if (is_array($uri)) {
            // Can only return one Location header.
            $uri = reset($uri);
        }
        $uri = $this->urlMapper->findUrls($uri);
        $headers = [];
        if ($uri) {
            $headers['Location'] = $uri;
        }
        return new Response(null, ($uri ? 200 : 404), $headers);
    }
1034339
protected function getController (Request $request)
		{
			if ($this->baseUri instanceof Pattern) {
				return call_user_func_array(
					$this->callback,
					array($this->baseUri->matches($request->getUri(false), true))
				);
			} else {
				return call_user_func($this->callback);
			}
		}
1072744
public function lockAction(Request $request)
    {
        // get request parameters
        $eid = (int) $request->get('eid');
        $language = $request->get('language');

        $elementService = $this->get('phlexible_element.element_service');
        $lockManager = $this->get('phlexible_element.element_lock_manager');

        $element = $elementService->findElement($eid);

        if ($lockManager->isLocked($element)) {
            return new ResultResponse(false, 'Element already locked.');
        } else {
            try {
                // try to lock the element
                $lockManager->lock($element, $this->getUser()->getId());

                return new ResultResponse(true, 'Lock aquired.');
            } catch (\Exception $e) {
                return new ResultResponse(false, $e->getMessage());
            }
        }
    }
763188
public function getReturnObject($request)
    {
        if (array_key_exists('isBatchPart', $request->options) && $request->options['isBatchPart'] === true) {
            return $request;
        } else {
            return $request->send();
        }
    }
955774
protected function retriesLeft( Request $request )
	{
		return UniversalBuilder::resolveClass( RateLimiter::class )->retriesLeft( $this->getThrottleKey( $request ), $this->maxLoginAttempts() );
	}
180703
public function get($requester, $request) {
		$permission = $this->_classes['permission'];
		return $permission::get($requester, $request);
	}
1105018
public static function canBeUsedForRequest(Request $request)
    {
        return $request->has(self::CHUNK_UUID_INDEX) && $request->has(self::CHUNK_TOTAL_INDEX) &&
            $request->has(self::CHUNK_INDEX);
    }
314338
public function getRouteForRequest(Request $request)
    {
        $routes = $this->collection->get($request->getMethod());

        return $this->check($routes, $request);
    }
1042099
public function match(Request $request)
    {
        // Get all the routes
        $routes = $this->getByMethod($request->getMethod());

        // Get the matching route out of the collection.
        $route = $this->getMatchingRoute($routes, $request);
        if (!is_null($route)) {
            return $route->bind($request);
        }

        // If no route was found we will now check if a matching route is specified by
        // another HTTP verb. If it is we will need to throw a MethodNotAllowed and
        // inform the user agent of which HTTP verb it should use for this route.
        /*$others = $this->checkForAlternateVerbs($request);
        if (count($others) > 0) {
            return $this->getRouteForMethods($request, $others);
        }*/

        throw new NotFoundHttpException('No route was found for the given request.');
    }
1231943
public function handleRequest($request)
    {
        // recursion for batch
        if ($request->isBatch()) {
            $batch = array();
            foreach ($request->requests as $req) {
                $batch[] = $this->handleRequest($req);
            }
            $responses = implode(',',array_filter($batch, function($a){return $a !== null;}));
            if ($responses != null) {
                return "[{$responses}]";
            } else {
                return null;
            }
        }

        // check validity of request
        if ($request->checkValid()) {
            // check for method existence
            if (!$this->methodExists($request->method)) {
                $request->error_code = ERROR_METHOD_NOT_FOUND;
                $request->error_message = "Method not found.";
                return $request->toResponseJSON();
            }

            // try to call method with params
            try {
                $response = $this->invokeMethod($request->method, $request->params);
                if (!$request->isNotify()) {
                    $request->result = $response;
                } else {
                    return null;
                }
            // handle exceptions
            } catch (\Exception $e) {
                $request->error_code = ERROR_EXCEPTION;
                $request->error_message = $e->getMessage();
            }
        }

        // return whatever we got
        return $request->toResponseJSON();
    }
755969
private function getParametersFromRequest(Request $request)
    {
        $parameters = $request->query->all();
        if ($routeParameters = $request->attributes->get('_route_params')) {
            $parameters = array_merge($routeParameters, $parameters);
        }

        return $parameters;
    }
874128
protected function doRequest(Request $request)
    {

        $this->client->send($request, $response = new Response());

        return $response;
    }