Skip to content

Can I get request from the middleware? #51

Closed
@FuturFuturFutur

Description

@FuturFuturFutur

I am working on package which I believe will build auto generated api documentation. It works based on tests coverage using middleware like this:

public function handle(Request $request, Closure $next)
    {
        $response = $next($request);

        if(Config::get('app.debug'))
            $this->docDocDocService->parse($request, $response);

        return $response;
    }

I can get request and response from each test, so I have status codes, parameters, bodies, headers, etc. Now I want to get validation rules from form requests. It works fine with form requests injected to the action as a parameter, as I can see json api server requests are not injected to action, but are initializing inside the actions, like this:

$request = ResourceQuery::queryOne(
            $resourceType = $route->resourceType()
        );

I can't see any possibility to get it inside the scope of the request, do you?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions