{"repo":"mikebronner/laravel-caffeine","free":true,"listed":false,"github":"https://github.com/mikebronner/laravel-caffeine","clone":"git clone https://github.com/mikebronner/laravel-caffeine.git","description":"Keeping Your Laravel Forms Awake.","language":"PHP","stars":939,"topics":["laravel","middleware","package"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"☕ Caffeine for Laravel 🗂️ Table of Contents - 📖 Summary - 📦 Installation - ⚙️ Configuration - 🚀 Usage - ⚠️ Considerations - ⬆️ Upgrading - 🤝 Contributing - 🔐 Security 📖 Summary Prevent forms from timing out when submitting them after leaving them on-screen for a considerable amount of time. Laravel defaults session lifetime to 120 minutes, but that is configurable and could be different site-by-site. ☕ Caffeine works by sending a \"drip\" — a lightweight AJAX request at regular intervals — to keep the session alive while a form is open. It only activates on pages with a token field or a csrf-token meta tag, so all other pages time-out as normal. 🔒 Why This Approach? This package keeps the integrity of your site's security by avoiding the following: - 🚫 Exposing the CSRF Token on an unsecured endpoint. - 🚫 Eliminating CSRF Token validation on specific routes, or altogether. - 🚫 Removing session-timeout on all pages. 📋 Requirements - PHP 8.2+ - Laravel 11, 12, or 13 📦 Installation ✨ The service provider is auto-discovered. No additional setup is required. ⚙️ Configuration Only publish the config file if you need to customize it : This creates the following config file: 🚀 Usage That's it! It will apply itself automatically where it finds a form with a token field, or a meta tag named \"csrf-token\", while pages are open in browsers. 🎉 🚫 Prevent Caffeination There are two methods to prevent Caffeine from keeping the session alive: 🏷️ Meta Tag Method Add the following","default_branch":null,"files":null,"tree":[],"storefront":"/r/mikebronner","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mikebronner/laravel-caffeine/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}