Accessing The Request: PSR-7 Requests
PSR-7 Requests
Use Psr\Http\Message\ServerRequestInterface;
Route::get('/', function (ServerRequestInterface $request) {
//
});
You may obtain a PSR-7 request by type-hinting the request interface on your route Closure or controller method.
Laravel uses the Symfony HTTP Message Bridge component to convert typical Laravel requests and responses into PSR-7 compatible implementations.