Best laravel framework open-source packages.

Laravel cookie auth

A Laravel middleware to set a cookie for authenticated users. Useful for Varnish/FastCGI cache.
Updated 2 months ago

Laravel Cookie Auth

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads Maintainability

A simple middleware for Laravel applications that creates a cookie for logged-in users. Used for simple configuration with FastCGI.

Installation

You can install the package via composer:

composer require the-3labs-team/laravel-cookie-auth

You can publish the config file with:

php artisan vendor:publish --tag="laravel-cookie-auth-config"

This is the contents of the published config file:

return [
    'cookie_name' => 'skip_cache',
    'cookie_value' => true,
    'cookie_lifetime' => 5,
];

Optionally, you can publish the views using

php artisan vendor:publish --tag="laravel-cookie-auth-views"

Usage

In your Kernel.php add the middleware as follows:

protected $middlewareGroups = [
    'web' => [
        \The3LabsTeam\LaravelCookieAuth\LaravelCookieAuth::class,
        //...

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.