Download the PHP package devtical/laravel-drunk-on-419 without Composer
On this page you can find all versions of the php package devtical/laravel-drunk-on-419. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devtical/laravel-drunk-on-419
More information about devtical/laravel-drunk-on-419
Files in devtical/laravel-drunk-on-419
Package laravel-drunk-on-419
Short Description Handles 419 errors gracefully by redirecting users when CSRF tokens expire.
License MIT
Homepage https://github.com/devtical/laravel-drunk-on-419
Informations about the package laravel-drunk-on-419
Drunk on 419
Handles 419 errors gracefully by redirecting users when CSRF tokens expire.
Installation
You can install the package via composer:
Usage
Automatic Middleware Registration
Once installed, the package automatically registers the middleware in the web group to handle CSRF token expiry errors. This means it will handle all requests in the web
middleware group without requiring manual registration.
Flashing Session Data
When a CSRF token expires and a 419 error occurs, the middleware redirects the user to the previous page (if available) or a fallback URL, with an error message flashed to the session. You can display the error message in your views using the following:
Publishing Language Files
You can publish the language files to customize the error message:
This will create a language file in your application at lang/vendor/drunkon419/session.php
. You can modify the expired
key to suit your needs:
License
The MIT License (MIT). Please see License File for more information.