{"id":24234919,"url":"https://github.com/devtical/laravel-drunk-on-419","last_synced_at":"2025-10-03T18:37:30.341Z","repository":{"id":271982761,"uuid":"915132024","full_name":"devtical/laravel-drunk-on-419","owner":"devtical","description":"Handles 419 errors gracefully by redirecting users when CSRF tokens expire.","archived":false,"fork":false,"pushed_at":"2025-02-03T03:15:06.000Z","size":8819,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-03T03:17:28.876Z","etag":null,"topics":["419","laravel"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devtical.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"kristories"}},"created_at":"2025-01-11T03:51:35.000Z","updated_at":"2025-02-03T03:15:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"abd71baa-fc51-4652-9738-27ad3185412a","html_url":"https://github.com/devtical/laravel-drunk-on-419","commit_stats":null,"previous_names":["devtical/laravel-drunk-on-419"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtical%2Flaravel-drunk-on-419","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtical%2Flaravel-drunk-on-419/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtical%2Flaravel-drunk-on-419/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtical%2Flaravel-drunk-on-419/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devtical","download_url":"https://codeload.github.com/devtical/laravel-drunk-on-419/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241864569,"owners_count":20033184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["419","laravel"],"created_at":"2025-01-14T17:38:24.933Z","updated_at":"2025-10-03T18:37:25.322Z","avatar_url":"https://github.com/devtical.png","language":"PHP","funding_links":["https://github.com/sponsors/kristories"],"categories":[],"sub_categories":[],"readme":"# Drunk on 419\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/devtical/laravel-drunk-on-419.svg?style=flat-square)](https://packagist.org/packages/devtical/laravel-drunk-on-419)\n[![Tests](https://img.shields.io/github/actions/workflow/status/devtical/laravel-drunk-on-419/run-tests.yml?label=tests\u0026style=flat-square)](https://github.com/devtical/laravel-drunk-on-419/actions/workflows/run-tests.yml)\n[![Total Downloads](https://img.shields.io/packagist/dt/devtical/laravel-drunk-on-419.svg?style=flat-square)](https://packagist.org/packages/devtical/laravel-drunk-on-419)\n\n![Cover](art/cover.png)\n\nHandles 419 errors gracefully by redirecting users when CSRF tokens expire.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require devtical/laravel-drunk-on-419\n```\n\n## Usage\n\n#### Automatic Middleware Registration\n\nOnce 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.\n\n#### Flashing Session Data\n\nWhen 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:\n\n```php\n@session('expired')\n    {{ $value }}\n@endsession\n```\n\n#### Publishing Language Files\n\nYou can publish the language files to customize the error message:\n\n```bash\nphp artisan vendor:publish --tag=drunkon419-translations\n```\n\nThis will create a language file in your application at `lang/vendor/drunkon419/session.php`. You can modify the `expired` key to suit your needs:\n\n```php\nreturn [\n    'expired' =\u003e 'Your session has expired. Please try again.',\n];\n```\n\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevtical%2Flaravel-drunk-on-419","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevtical%2Flaravel-drunk-on-419","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevtical%2Flaravel-drunk-on-419/lists"}