2017 © Pedro Peláez
 

library 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.

image

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.

  • Tuesday, January 30, 2018
  • by DivineOmega
  • Repository
  • 5 Watchers
  • 1 Stars
  • 70 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

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., (*1)

Laravel does not handle this situation and may end up throwing a somewhat confusing TokenMismatchException in VerifyCsrfToken due to CSRF protection., (*2)

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., (*3)

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., (*4)

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.

The Versions

30/01 2018

dev-master

9999999-dev https://github.com/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.

  Sources   Download

LGPL3 LGPL-3.0-only

The Requires

 

laravel middleware post post data no post data middleware

30/01 2018

v1.0.3

1.0.3.0 https://github.com/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.

  Sources   Download

LGPL-3.0-only

The Requires

 

laravel middleware post post data no post data middleware

24/04 2017

v1.0.2

1.0.2.0 https://github.com/rapidwebltd/no-post-data-laravel-middleware

No Post Data Laravel Middleware

  Sources   Download

LGPL3

The Requires

 

laravel middleware post post data no post data middleware

17/02 2017

v1.0.1

1.0.1.0 https://github.com/rapidwebltd/no-post-data-laravel-middleware

No Post Data Laravel Middleware

  Sources   Download

LGPL3

The Requires

 

laravel middleware post post data no post data middleware

01/02 2017

v1.0

1.0.0.0 https://github.com/rapidwebltd/no-post-data-laravel-middleware

No Post Data Laravel Middleware

  Sources   Download

LGPL3

The Requires

 

laravel middleware post post data no post data middleware