PHPackages                             whyounes/laravel-passwordless-auth - 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. whyounes/laravel-passwordless-auth

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

whyounes/laravel-passwordless-auth
==================================

Laravel passwordless authentication for Laravel

v1.1(9y ago)641[1 issues](https://github.com/Whyounes/laravel-passwordless-auth/issues)MITPHPPHP ^5.5.9 || ^7.0

Since Nov 22Pushed 9y ago2 watchersCompare

[ Source](https://github.com/Whyounes/laravel-passwordless-auth)[ Packagist](https://packagist.org/packages/whyounes/laravel-passwordless-auth)[ Docs](https://github.com/whyounes/laravel-passwordless-auth)[ RSS](/packages/whyounes-laravel-passwordless-auth/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (4)Used By (0)

Laravel Passwordless
====================

[](#laravel-passwordless)

Passwordless authentication for Laravel 5

 [ ![Build status](https://camo.githubusercontent.com/89a74524ed69126c5a2303dbfe9194a8a76e1f8b102cc0981cdb279970557f35/68747470733a2f2f7472617669732d63692e6f72672f5768796f756e65732f6c61726176656c2d70617373776f72646c6573732d617574682e7376673f6272616e63683d6d6173746572) ](https://travis-ci.org/Whyounes/laravel-passwordless-auth) [ ![](https://camo.githubusercontent.com/be54e1a9128ca768f676ae2ecc01f558df3f9feb650c654ac8b05aacf73e552e/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f38633739363462662d353864352d343232392d393238622d6435373031306637313937372f6d696e692e706e67) ](https://insight.sensiolabs.com/projects/8c7964bf-58d5-4229-928b-d57010f71977)

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

[](#installation)

Add the package to your project using Composer:

```
composer require whyounes/laravel-passwordless-auth
```

Publish package assets:

```
php artisan vandor:publish
```

Run the migration to create the tokens table:

```
php artisan migrate
```

Add it to you providers list:

```
// config/app.php

// ...
'providers' => [
    // ...
    Whyounes\Passwordless\Providers\PasswordlessProvider::class,
};
```

Add the `Passwordless` trait to your user model:

```
// app/User.php

class User extends Authenticatable
{
    use Whyounes\Passwordless\Traits\Passwordless;

    // ...
}
```

Configurations
--------------

[](#configurations)

If you don't want to use the user email along with the token, you can change it by overriding the following method:

```
// app/User.php

class User extends Authenticatable
{
    use Whyounes\Passwordless\Traits\Passwordless;

    // ...

    protected function getIdentifierKey()
    {
        return 'email';
    }
}
```

You can change the expiration time inside the `config/passwordless.php` file:

```
// config/passwordless.php

return [
    'expire_in' => 15, // Minutes
    'empty_tokens_after_login' => true // Empty user tokens after login
];
```

You can set the `empty_tokens_after_login` config to false if you don't want to delete unused tokens from DB.

Example
-------

[](#example)

Display the login form for user to type the email:

```
// routes/web.php

Route::post('/login/direct', function() {
    return view('login.direct');
});
```

Catch the form submission:

```
// routes/web.php

Route::post('/login/direct', function(Request $request) {
    // send link to user mail
    $user = App\User::where('email', $request->get('email'))->first();
    if (!$user) {
        return redirect()->back(404)->with('error', 'User not found');
    }

    // generate token and save it
    $token = $user->generateToken(true);

    // send email to user
    \Mail::send("mails.login", ['token' => $token], function($message) use($token) {
        $message->to($token->user->email);
    });
});
```

Catch the login link request:

```
// routes/web.php

Route::get('/login/{token}', function(Request $request, $token) {
    $user = App\User::where('email', $request->get('email'))->first();

    if (!$user) {
        dd('User not found');
    }

    if($user->isValidToken($token))
    {
        // Login user
        Auth::login($user);
    } else {
        dd("Invalid token");
    }
});
```

Or, if you like working with exceptions:

```
// routes/web.php

Route::get('/login/{token}', function(Request $request, $token) {
    try {
        $user = App\User::where('email', $request->get('email'))->firstOrFail();
        $user->validateToken($token);

        Auth::login($user);
    } catch(Illuminate\Database\Eloquent\ModelNotFoundException $ex) {
        dd('User not found');
    } catch(Whyounes\Passwordless\Exceptions\InvalidTokenException $ex) {
        dd("Invalid token");
    }
});
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

3505d ago

Major Versions

v0.1 → v1.02016-11-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e77e863a88494fe41ab35f0d3fa40d08172040ea801aa558672af608da4e1e1?d=identicon)[Whyounes](/maintainers/Whyounes)

---

Top Contributors

[![Whyounes](https://avatars.githubusercontent.com/u/1175548?v=4)](https://github.com/Whyounes "Whyounes (23 commits)")

---

Tags

authPasswordless

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/whyounes-laravel-passwordless-auth/health.svg)

```
[![Health](https://phpackages.com/badges/whyounes-laravel-passwordless-auth/health.svg)](https://phpackages.com/packages/whyounes-laravel-passwordless-auth)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k14.1M123](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9772.3M122](/packages/roots-acorn)[cesargb/laravel-magiclink

Create secure link for access to private data or login in Laravel without password

4631.4M](/packages/cesargb-laravel-magiclink)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
