Download the PHP package genealabs/laravel-caffeine without Composer

On this page you can find all versions of the php package genealabs/laravel-caffeine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-caffeine

โ˜• Caffeine for Laravel

GitHub Actions Scrutinizer GitHub (pre-)release Packagist GitHub license PHP Version Laravel GitHub Stars

Caffeine for Laravel masthead image.

๐Ÿ—‚๏ธ Table of Contents

๐Ÿ“– 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:

๐Ÿ“‹ Requirements

๐Ÿ“ฆ 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 meta tag to any page you want to exclude:

๐Ÿ›ฃ๏ธ Route Middleware Method

Publish the config file and set use-route-middleware to true. This disables the default global middleware mode. Then selectively enable Caffeine on specific routes or route groups:

๐Ÿ“ Note: This will only have effect if the page includes a form. If not, the page will not caffeinate your application anyway.

โš ๏ธ Considerations

๐Ÿ”Œ Livewire / Inertia / SPA

This package works by injecting JavaScript that pings a keep-alive endpoint. It is designed for traditional Blade forms. If you are using Livewire or Inertia, their built-in request cycles typically keep the session alive already, so this package is generally unnecessary in those contexts.

๐Ÿšง Incompatible Packages

๐Ÿ›ค๏ธ Routes

This package registers routes under genealabs/laravel-caffeine.

โฌ†๏ธ Upgrading

0.6.0

This update changed the config file setting names. Delete the published config file config/genealabs-laravel-caffeine.php if it exists, and re-publish using the command in the Configuration section.

For all other version changes, see the Releases page on GitHub.

๐Ÿค Contributing

Contributions are welcome! ๐ŸŽ‰ Please review the Contribution Guidelines and observe the Code of Conduct before submitting a pull request.

๐Ÿงช Quality Checklist

๐Ÿ” Security

If you discover a security vulnerability, please report it via GitHub Security Advisories rather than opening a public issue.


Built with โค๏ธ for the Laravel community using lots of โ˜• by Mike Bronner.

This is an MIT-licensed open-source project. Its continued development is made possible by the community. If you find it useful, please consider ๐Ÿ’– becoming a sponsor and โญ starring it on GitHub.


All versions of laravel-caffeine with dependencies

PHP Build Version
Package Version
Requires illuminate/routing Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package genealabs/laravel-caffeine contains the following files

Loading the files please wait ...