PHPackages                             rapidwebltd/no-post-data-laravel-middleware - 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. rapidwebltd/no-post-data-laravel-middleware

ActiveLibrary

rapidwebltd/no-post-data-laravel-middleware
===========================================

Under certain conditions, when posting data from a form, the web server may lose the post data. This commonly happens if a user is uploading a large file beyond the size limits set in the web server's configuration. Laravel does not handle this situation and may end up throwing a somewhat confusing `TokenMismatchException in VerifyCsrfToken` due to CSRF protection. The 'No Post Data Laravel Middleware' handles situations in which a post request has been submitted and contains no post data - a situation which should not occur under normal usage. By default, the middleware will redirect back to the previous page with an error message flashed to the session. This can then be output on your view as you would normally handle validation errors. If needed, you can also modify this default behaviour and allow any code to run when the 'post request with no post data' situation is encountered.

v1.0.3(8y ago)078LGPL-3.0-onlyPHPPHP &gt;=5.5.9

Since Feb 1Pushed 8y ago4 watchersCompare

[ Source](https://github.com/rapidwebltd/no-post-data-laravel-middleware)[ Packagist](https://packagist.org/packages/rapidwebltd/no-post-data-laravel-middleware)[ Docs](https://github.com/rapidwebltd/no-post-data-laravel-middleware)[ RSS](/packages/rapidwebltd-no-post-data-laravel-middleware/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

No Post Data Laravel Middleware
===============================

[](#no-post-data-laravel-middleware)

Under certain conditions, when posting data from a form, the web server may lose the post data. This commonly happens if a user is uploading a large file beyond the size limits set in the web server's configuration.

Laravel does not handle this situation and may end up throwing a somewhat confusing `TokenMismatchException in VerifyCsrfToken` due to CSRF protection.

The 'No Post Data Laravel Middleware' handles situations in which a post request has been submitted and contains no post data - a situation which should not occur under normal usage. By default, the middleware will redirect back to the previous page with an error message flashed to the session. This can then be output on your view as you would normally handle validation errors.

If needed, you can also modify this default behaviour and allow any code to run when the 'post request with no post data' situation is encountered.

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

[](#installation)

1. Run `composer require rapidwebltd/no-post-data-laravel-middleware`.
2. Add `RapidWeb\NoPostDataLaravelMiddleware\ServiceProvider::class,` to the `providers` array in your `config/app.php` file.
3. Add `\RapidWeb\NoPostDataLaravelMiddleware\Http\Middleware\NoPostData::class,` to the `middleware` array in your `app/Http/Kernel.php` file. This must be added after `\Illuminate\View\Middleware\ShareErrorsFromSession::class,` and before `\App\Http\Middleware\VerifyCsrfToken::class,`.
4. Run `php artisan vendor:publish`.
5. If you wish, edit the default `errorMessage` variable in your newly published `config/nopostdata.php` file.
6. If you want to fully change the middleware's behaviour, you can also edit the `closure` variable found in the `config/nopostdata.php` file.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

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 ~121 days

Total

4

Last Release

3025d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (3 commits)")[![kirsty-gasston](https://avatars.githubusercontent.com/u/12949343?v=4)](https://github.com/kirsty-gasston "kirsty-gasston (2 commits)")

---

Tags

laravellaravel-5-packagemiddlewaremiddlewarelaravelpostpost datano post data middleware

### Embed Badge

![Health badge](/badges/rapidwebltd-no-post-data-laravel-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/rapidwebltd-no-post-data-laravel-middleware/health.svg)](https://phpackages.com/packages/rapidwebltd-no-post-data-laravel-middleware)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[masterro/laravel-xss-filter

Filter user input for XSS but don't touch other html

41254.5k](/packages/masterro-laravel-xss-filter)[spatie/laravel-authorize

A middleware to check authorization

20125.8k1](/packages/spatie-laravel-authorize)

PHPackages © 2026

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