Skip to content

Commit

Permalink
Background information on why middleware is needed and explanation of…
Browse files Browse the repository at this point in the history
… its function
  • Loading branch information
Jordan Hall committed Feb 1, 2017
1 parent 904e66b commit b416ab0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
@@ -1,5 +1,16 @@
# No Post Data Laravel Middleware

Under certain conditions, when posting data from a form, the web server may loose 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 request 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

1. Run `composer require rapidwebltd/no-post-data-laravel-middleware`.
Expand Down

0 comments on commit b416ab0

Please sign in to comment.