Retrieving The Request Method
The method method will return the HTTP verb for the request. You may also use the isMethod method to verify that the HTTP verb matches a given string:
PSR-7 Requests
The PSR-7 standard specifies interfaces for HTTP messages, including requests and responses. If you would like to obtain an instance of a PSR-7 request, you will first need to install a few libraries. Laravel uses the Symfony HTTP Message Bridge component to convert typical Laravel requests and responses into PSR-7 compatible implementations:
Once you have installed these libraries, you may obtain a PSR-7 request by simply type-hinting the request type on your route or controller:
If you return a PSR-7 response instance from a route or controller, it will automatically be converted back to a Laravel response instance and be displayed by the framework.