PHPackages                             richardstyles/laravel-vapor-support - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. richardstyles/laravel-vapor-support

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

richardstyles/laravel-vapor-support
===================================

Adds additional support for Laravel vapor applications

v1.0.2(4y ago)55[2 PRs](https://github.com/RichardStyles/laravel-vapor-support/pulls)MITPHPPHP ^7.4|^8.0|^8.1

Since Jun 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/RichardStyles/laravel-vapor-support)[ Packagist](https://packagist.org/packages/richardstyles/laravel-vapor-support)[ Docs](https://github.com/richardstyles/laravel-vapor-support)[ RSS](/packages/richardstyles-laravel-vapor-support/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (13)Versions (6)Used By (0)

[![](https://camo.githubusercontent.com/2bedf63f24cda7efab02da955dc11fb7ef8a060e2f26b73c33a7aac84529b8a3/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f737570706f72742d756b7261696e652e7376673f743d31)](https://supportukrainenow.org)

Laravel Vapor Support
=====================

[](#laravel-vapor-support)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ee68dbac9246fbddbc3792c21f418ed64f9d5076b0291d7d1256b2fbcc329401/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726963686172647374796c65732f6c61726176656c2d7661706f722d737570706f72742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/richardstyles/laravel-vapor-support)[![GitHub Tests Action Status](https://camo.githubusercontent.com/e8693751f804857f4a29565bd960544ecbc422f06b80d8456509d04e0280943e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f726963686172647374796c65732f6c61726176656c2d7661706f722d737570706f72742f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/richardstyles/laravel-vapor-support/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/07abc237716c9eb7e424118602b8325463f500b6ed5142be6b22c650e8b9e68f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f726963686172647374796c65732f6c61726176656c2d7661706f722d737570706f72742f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/richardstyles/laravel-vapor-support/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/e81728d9b12fbde4b273735109d434411cbda9b995e0c6c0b32da6ed934e8ef9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726963686172647374796c65732f6c61726176656c2d7661706f722d737570706f72742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/richardstyles/laravel-vapor-support)

A small support package to help large Vapor applications which may occasionally hit "Internal Server Error" due to large request sizes.

This package provides a middleware to monitor the main response:

- Illuminate\\Http\\Response
- Illuminate\\Http\\JsonResponse
- Symfony\\Component\\HttpFoundation\\BinaryFileResponse

There is also support for:

- Symfony\\Component\\HttpFoundation\\StreamedResponse

However, because a streamed response length is generally unknown, by default a 'info' level log is recorded to aid debugging.

This package provides a middleware which can be used to monitor the length of the response body. This allows you to be notified if a page is starting to exceed the Vapor/AWS limits. The default logs included allow for route name (if set), url and size to be logged to help you pinpoint any pages of concern.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require richardstyles/laravel-vapor-support
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-vapor-support-config"
```

This is the contents of the published config file:

```
return [
    'warning_size' => env('VAPOR_SUPPORT_RESPONSE_WARNING_SIZE', 5000000),
    'warning_action' => \RichardStyles\LaravelVaporSupport\Actions\ResponseSizeWarning::class,

    'limit_size' => env('VAPOR_SUPPORT_RESPONSE_LIMIT_SIZE', 6000000),
    'limit_action' => \RichardStyles\LaravelVaporSupport\Actions\ResponseSizeLimit::class,

    'stream_action' => \RichardStyles\LaravelVaporSupport\Actions\StreamResponseMonitor::class,
];
```

Usage
-----

[](#usage)

Simply add the middleware to either the Kernal.

app/Http/Kernel.php

```
protected $middlewareGroups = [
        'web' => [
             ...
            \RichardStyles\LaravelVaporSupport\Http\Middleware\ResponseLimitMonitor::class,
        ],
        ...
```

Or as a named middleware to use on individual routes.

```
protected $routeMiddleware = [
        ...
        'response.monitor' => \RichardStyles\LaravelVaporSupport\Http\Middleware\ResponseLimitMonitor::class,
    ];
```

For monitoring response sizes (in **bytes**), these can be set in your .ENV, or by modifying the config.

*Examples set very low*

```
VAPOR_SUPPORT_RESPONSE_WARNING_SIZE=1000
VAPOR_SUPPORT_RESPONSE_LIMIT_SIZE=5000
```

Using the example above would cause;

- The Warning class run when response body exceeds "1000" bytes.
- The Limit class runs when response body exceeds "5000" bytes.

The config also allows the base classes to be overridden. The Limit and Warning classes must implement `RichardStyles\LaravelVaporSupport\Contracts\HandlesResponsesLimit`The stream response should implement `RichardStyles\LaravelVaporSupport\Contracts\HandlesStreamResponse` as with streamed responses you cannot easily know it's length.

The default actions taken by this package is to Log either:

- Log info on streamed response
- Log warning when request length exceeds `warning_size`
- Log critical when request length exceeds `limit_size`

By implementing your own classes and setting these within the config `vapor-support` you can notify/alert however your application requires, such as to Bugsnag or other third party services.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Support
-------

[](#support)

If you are having general issues with this package, feel free to contact me on [Twitter](https://twitter.com/StylesGoTweet).

If you believe you have found an issue, please report it using the [GitHub issue tracker](https://github.com/RichardStyles/EloquentEncryption/issues), or better yet, fork the repository and submit a pull request with a failing test.

If you're using this package, I'd love to hear your thoughts. Thanks!

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Richard Styles](https://github.com/RichardStyles)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1471d ago

PHP version history (2 changes)v1.0.0PHP ^8.0|^8.1

v1.0.1PHP ^7.4|^8.0|^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/72f95111dc92cab50312c2d2917c40ec8fd45afb3bb437bd2a5755ca56126dcb?d=identicon)[RichardStyles](/maintainers/RichardStyles)

---

Top Contributors

[![RichardStyles](https://avatars.githubusercontent.com/u/1642215?v=4)](https://github.com/RichardStyles "RichardStyles (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")

---

Tags

laravellaravel-vaporrichardstyleslaravel-vapor-support

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/richardstyles-laravel-vapor-support/health.svg)

```
[![Health](https://phpackages.com/badges/richardstyles-laravel-vapor-support/health.svg)](https://phpackages.com/packages/richardstyles-laravel-vapor-support)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)[tapp/filament-form-builder

User facing form builder using Filament components

132.4k3](/packages/tapp-filament-form-builder)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
