LaravelPackages.net
Acme Inc.
Toggle sidebar
cyrildewit/laravel-silent-authentication

Silent authentication methods for Laravel

117
3
v0.1.2
About cyrildewit/laravel-silent-authentication

cyrildewit/laravel-silent-authentication is a Laravel package for silent authentication methods for laravel. It currently has 3 GitHub stars and 117 downloads on Packagist (latest version v0.1.2). Install it with composer require cyrildewit/laravel-silent-authentication. Discover more Laravel packages by cyrildewit or browse all Laravel packages to compare alternatives.

Last updated

Laravel Silent Authentication

This Laravel >= 5.5 package allows you to silently authenticate users.

Overview

I created this package for personal usage. It's based on insights from other open source packages and online blog posts.

Documentation

In this documentation, you will find some helpful information about the use of this Laravel package.

Table of contents

  1. Getting Started
  2. Usage

Getting Started

Requirements

This package requires PHP 7.1+ and Laravel 5.5+.

Lumen is not supported!

Version information

| Version | Illuminate | Status | PHP Version | |---------|------------|----------------|-------------| | 1.0 | 5.5 - 5.7 | Active support | >= 7.1.0 |

Installation

First, you need to install the package via Composer:

composer require cyrildewit/laravel-silent-authentication

You can optionally publish the config file with:

php artisan vendor:publish --provider="CyrildeWit\LaravelSilentAuthentication\SilentAuthenticationServiceProvider" --tag="config"

Register service provider manually

If you prefer to register packages manually, you can add the following provider to your application's providers list.

// config/app.php

'providers' => [
    // ...
    CyrildeWit\LaravelSilentAuthentication\SilentAuthenticationServiceProvider::class,
];

Usage

Default setup

This package will overwrite the default SessionGuard by default. The customized session guard uses the SilentAuthentication trait which will allow you silently authenticate users.

If you're not interesting in this default or if it's breaking your application, you can disable it in the config file.

SilentAuthentication trait

If you're already overwriting the default SessionGuard in your application, you can simply implement the SilentAuthentication trait.

use Illuminate\Auth\SessionGuard as BaseSessionGuard;
use CyrildeWit\LaravelSilentAuthentication\Guards\Traits\SilentAuthentication;

class SessionGuard extends BaseSessionGuard
{
    use SilentAuthentication;
}

Changelog

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

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Star History Chart