Download the PHP package myerscode/laravel-sub-request without Composer
On this page you can find all versions of the php package myerscode/laravel-sub-request. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download myerscode/laravel-sub-request
More information about myerscode/laravel-sub-request
Files in myerscode/laravel-sub-request
Package laravel-sub-request
Short Description A helper and facade for making internal API sub requests to your application
License MIT
Homepage https://github.com/myerscode/laravel-sub-request
Informations about the package laravel-sub-request
Laravel Sub Request
A helper and facade for making internal sub requests to your application API.
By sending a sub request within the application, you can consume your application's API without sending separate, slower HTTP requests.
Requirements
- PHP 8.5+
- Laravel 13.x
Install
The package will be auto-discovered by Laravel.
Usage
You can inject the Dispatcher into your class, use the SubRequest facade, or use the global subrequest helper.
Available Methods
The Dispatcher provides shortcut methods for all HTTP verbs:
Custom Headers
All methods accept an optional $headers array as the last parameter, allowing you to set custom headers on the sub request:
Headers are applied to the sub request and automatically restored to their original values after dispatch.
Cookies
All methods accept an optional $cookies array as the last parameter, allowing you to forward or set cookies on the sub request:
Cookies are applied to the sub request and automatically restored to their original values after dispatch.
Middleware Control
Use withoutMiddleware() to skip specific middleware on a sub request:
The middleware exclusion is automatically reset after each dispatch, so subsequent calls will run all middleware as normal.
License
MIT
All versions of laravel-sub-request with dependencies
illuminate/http Version ^13.0
illuminate/routing Version ^13.0
illuminate/support Version ^13.0