PHPackages                             dgtlinf/passwordless - 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. dgtlinf/passwordless

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

dgtlinf/passwordless
====================

Headless Laravel package for passwordless authentication via magic link or OTP code

v1.0.4(7mo ago)13MITPHPPHP ^8.2CI passing

Since Oct 8Pushed 7mo agoCompare

[ Source](https://github.com/dgtlinf/passwordless)[ Packagist](https://packagist.org/packages/dgtlinf/passwordless)[ RSS](/packages/dgtlinf-passwordless/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (6)Used By (0)

🔐 Passwordless Laravel Package
==============================

[](#-passwordless-laravel-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/782c0a613f37f63f7531f89d426ae77f28f08ea8d61f7e5d07ddbd3908e29748/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6467746c696e662f70617373776f72646c6573732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dgtlinf/passwordless)[![GitHub Tests Action Status](https://camo.githubusercontent.com/cb037311108be30faca91d019e45e7afcf38f0664a7b383e1b386354d5fab0bd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6467746c696e662f70617373776f72646c6573732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/dgtlinf/passwordless/actions)[![License](https://camo.githubusercontent.com/3d7a8228cfb54e923e63fd2fdfd5716cf25e1f6f802a746ce79060dad3610315/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6467746c696e662f70617373776f72646c6573732e7376673f7374796c653d666c61742d737175617265)](https://github.com/dgtlinf/passwordless/blob/main/LICENSE.md)

A modern, headless, and framework-agnostic **passwordless authentication** system for Laravel.
Easily send magic links and OTP codes without managing passwords.

---

🚀 Features
----------

[](#-features)

- 🔑 Passwordless login with OTP or magic link
- ⚙️ Configurable OTP length and type (numeric, alpha, alphanumeric)
- 🕒 Expiration control for tokens and magic links
- 📬 Notification-based delivery (email-ready, customizable channel)
- 🧩 Event-driven: `PasswordlessTokenCreated`, `PasswordlessTokenConsumed`, `PasswordlessLoginSucceeded`
- 🌍 Localization-ready (translations publishable)
- 🧪 100% test coverage with Pest + Orchestra Testbench
- 🧱 Fully decoupled — no frontend required

---

⚙️ Installation
---------------

[](#️-installation)

```
composer require dgtlinf/passwordless
```

Then publish the configuration and migration with the easy install command:

```
php artisan passwordless:install
```

or you can just publish things separately:

```
php artisan vendor:publish --tag="passwordless-config"
php artisan vendor:publish --tag="passwordless-migrations"
php artisan migrate
```

---

🧩 Configuration
---------------

[](#-configuration)

File: `config/passwordless.php`

### Key sections:

[](#key-sections)

#### `models`

[](#models)

Define which models to use.
You can override both the User model and the Token model.

```
'models' => [
    'user'  => App\Models\User::class,
    'token' => Dgtlinf\Passwordless\Models\PasswordlessToken::class,
],
```

#### `notification`

[](#notification)

Define which notification class is used to deliver OTPs or links, and which route name generates the magic link.

```
'notification' => [
    'class' => Dgtlinf\Passwordless\Notifications\PasswordlessLoginNotification::class,
    'route' => 'passwordless.magic', // used by URL::temporarySignedRoute()
],
```

#### `otp`

[](#otp)

Configure OTP behavior.

```
'otp' => [
    'length' => 6,
    'type'   => 'numeric', // 'alpha' | 'alphanumeric' | 'numeric'
],
```

#### `link`

[](#link)

Configure token expiration for the magic link.

```
'link' => [
    'expire_minutes' => 30,
    'token_length'   => 64,
],
```

#### `prune`

[](#prune)

Automatic cleanup for old tokens (via Laravel’s model pruning).

```
'prune' => [
    'enabled' => true,
    'after_days' => 7,
],
```

---

🧠 Usage
-------

[](#-usage)

### 1️⃣ Add the trait to your User model

[](#1️⃣-add-the-trait-to-your-user-model)

```
use Dgtlinf\Passwordless\Traits\HasPasswordlessLogin;

class User extends Authenticatable
{
    use Notifiable, HasPasswordlessLogin;
}
```

### 2️⃣ Trigger passwordless login

[](#2️⃣-trigger-passwordless-login)

```
use Dgtlinf\Passwordless\Facades\Passwordless;

Passwordless::send($user); // Sends OTP + magic link
```

### 3️⃣ Verify OTP or token

[](#3️⃣-verify-otp-or-token)

```
Passwordless::verifyOtp($user, $otp);     // via code
Passwordless::verifyToken($user, $token); // via magic link
```

---

🧩 Events
--------

[](#-events)

The following events are dispatched automatically and can be listened to in your app:

EventDescription`PasswordlessTokenCreated`Fired when a token and OTP are generated`PasswordlessTokenConsumed`Fired when a token is successfully used`PasswordlessLoginSucceeded`Fired when login completes successfullyExample listener registration (`EventServiceProvider`):

```
protected $listen = [
    Dgtlinf\Passwordless\Events\PasswordlessLoginSucceeded::class => [
        App\Listeners\LogPasswordlessLogin::class,
    ],
];
```

---

🌍 Translations
--------------

[](#-translations)

Translations are stored in `resources/lang/vendor/passwordless/en/passwordless.php` and can be published via:

```
php artisan vendor:publish --tag="passwordless-translations"
```

---

🧪 Testing
---------

[](#-testing)

Run test suite:

```
vendor/bin/pest
```

All tests run using in-memory SQLite and are automatically configured via Orchestra Testbench.

---

🧾 License
---------

[](#-license)

Released under the **MIT License**.
Copyright © Digital Infinity DOO Novi Sad.

**Website:** [digitalinfinity.rs](https://www.digitalinfinity.rs)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance64

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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

5

Last Release

216d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc897661efd3f9b1d0b6cee6fa6eb2f5535819e0c2e0a0adab66b4d6002133be?d=identicon)[gorankrgovic](/maintainers/gorankrgovic)

---

Top Contributors

[![gorankrgovic](https://avatars.githubusercontent.com/u/12137730?v=4)](https://github.com/gorankrgovic "gorankrgovic (12 commits)")

---

Tags

laravelotpauthPasswordless

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/dgtlinf-passwordless/health.svg)

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

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[jurager/teams

Laravel package to manage team functionality and operate with user permissions.

22817.3k](/packages/jurager-teams)[lakm/nopass

Provides passwordless authentication for your laravel projects.

2213.6k2](/packages/lakm-nopass)[juliomotol/laravel-auth-timeout

Authentication Timeout for Laravel

43132.1k](/packages/juliomotol-laravel-auth-timeout)

PHPackages © 2026

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