private function initializeHandler(
        ResourceManager $resourceManager,
        string $resource,
        ApiRequest $request,
        string $checkInterface = null
    )
    {
        $handler = $resourceManager->resolveRequestHandler($resource);
        if ($handler instanceof NeedsAuthenticatedUser && !\Auth::check()) {
            throw new HttpException(401, 'Unauthorized Request');
        }

        if ($checkInterface !== null) {
            if (!$handler instanceof $checkInterface) {
                throw new HttpException(400, 'Bad Request');
            }
        }

        $filterFactory = $resourceManager->resolveFilterFactory($resource);

        $handler
            ->setRequest($request)
            ->setFilters($request->filters())
            ->setFilterFactory($filterFactory);

        return $handler;
    }
private function initializeHandler(
        ResourceManager $resourceManager,
        string $resource,
        ApiRequest $request,
        string $checkInterface = null
    )
    {
        $handler = $resourceManager->resolveRequestHandler($resource);
        if ($handler instanceof NeedsAuthenticatedUser && !\Auth::check()) {
            throw new HttpException(401, 'Unauthorized Request');
        }

        if ($checkInterface !== null) {
            if (!$handler instanceof $checkInterface) {
                throw new HttpException(400, 'Bad Request');
            }
        }

        $filterFactory = $resourceManager->resolveFilterFactory($resource);

        $handler
            ->setRequest($request)
            ->setFilters($request->filters())
            ->setFilterFactory($filterFactory);

        return $handler;
    }
private function initializeHandler ( ResourceManager $ resourceManager , string $ resource , ApiRequest $ request , string $ checkInterface = null ) { $ handler = $ resourceManager -> resolveRequestHandler ( $ resource ) ; if ( $ handler instanceof NeedsAuthenticatedUser && ! \ Auth :: check ( ) ) { throw new HttpException ( 401 , 'Unauthorized Request' ) ; } if ( $ checkInterface !== null ) { if ( ! $ handler instanceof $ checkInterface ) { throw new HttpException ( 400 , 'Bad Request' ) ; } } $ filterFactory = $ resourceManager -> resolveFilterFactory ( $ resource ) ; $ handler -> setRequest ( $ request ) -> setFilters ( $ request -> filters ( ) ) -> setFilterFactory ( $ filterFactory ) ; return $ handler ; }
returns initialized handler

@param ResourceManager $resourceManager
@param string $resource
@param ApiRequest $request
@param string|null $checkInterface
@return \Ipunkt\LaravelJsonApi\Contracts\RequestHandlers\ApiRequestHandler
returns initialized handler