PHPackages                             laravie/authen - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. laravie/authen

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

laravie/authen
==============

User Authentication Identifiers for Laravel

v3.1.0(3y ago)6559.2k—0%31MITPHPPHP ^7.3 || ^8.0CI failing

Since Nov 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/laravie/authen)[ Packagist](https://packagist.org/packages/laravie/authen)[ Fund](https://paypal.me/crynobone)[ Fund](https://liberapay.com/crynobone)[ RSS](/packages/laravie-authen/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (4)Versions (24)Used By (1)

User Authentication Identifiers for Laravel
===========================================

[](#user-authentication-identifiers-for-laravel)

[![tests](https://github.com/laravie/authen/workflows/tests/badge.svg?branch=2.x)](https://github.com/laravie/authen/actions?query=workflow%3Atests+branch%3A2.x)[![Latest Stable Version](https://camo.githubusercontent.com/b9c9ffbbcfec38329fc12dcf37754fbdc443a870ed91e64b8eee11048763d8f2/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617669652f61757468656e2f762f737461626c65)](https://packagist.org/packages/laravie/authen)[![Total Downloads](https://camo.githubusercontent.com/b9f85aac9d9f9856736e8eaffd7d75a7bba27c5c03aad66137d9c4fb9148854e/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617669652f61757468656e2f646f776e6c6f616473)](https://packagist.org/packages/laravie/authen)[![Latest Unstable Version](https://camo.githubusercontent.com/0e194fd582c871fa88c2c674515df4f28386f6f2f96699e5c3dc94e87356eff3/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617669652f61757468656e2f762f756e737461626c65)](https://packagist.org/packages/laravie/authen)[![License](https://camo.githubusercontent.com/0d9a0db8d49c32c6e233881fd83619bcc3b4570f2da411b9dda6becb3db315db/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617669652f61757468656e2f6c6963656e7365)](https://packagist.org/packages/laravie/authen)[![Coverage Status](https://camo.githubusercontent.com/a2820e925f2bcec8b53b4bfe1deaa9354e3f36c263a5c38ca1532ca037e812b5/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c6172617669652f61757468656e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/laravie/authen?branch=master)

Imagine you need to login a user with either "email", "username" or "phone number" just like how Facebook allows it. This is not possible with Laravel since you're limited to only one unique username/identifier key. This package attempt to solve the issue by allowing to use a unified key "identifier" and you can customize which attributes Laravel should check during authentication.

Installation
------------

[](#installation)

To install through composer, run the following command from terminal:

```
composer require "laravie/authen"

```

Usages
------

[](#usages)

### Service Provider

[](#service-provider)

First you can attach the auth provider on `App\Providers\AuthServiceProvider`:

```
