mydnic / laravel-allow-long-request
Simple Middleware Allowing Long Requests
v2.4.0
2020-09-15 11:44 UTC
Requires
- php: ^7.2
- laravel/framework: ^5.0|^6.0|^7.0|^8.0
Requires (Dev)
- mockery/mockery: ^1.3
- orchestra/testbench: ^3.7.8
- phpunit/phpunit: ^7.5
README
Installation
You can install this package via composer using this command:
composer require mydnic/laravel-allow-long-request
The package will automatically register itself
You can publish the config-file with:
php artisan vendor:publish --provider="Mydnic\AllowLongRequests\AllowLongRequestsServiceProvider" --tag="config"
Usage
In your Kernel.php you can register the middleware like this:
protected $routeMiddleware = [ // ... 'allow-long-request' => \Mydnic\AllowLongRequests\Http\Middleware\AllowLongRequests::class, ]
Now you can apply the middleware on the route of your choice
Route::get('/', function () { // code that takes a long time to execute })->middleware('allow-long-request');
You can set the max waiting time in the config file.