PHPackages                             spykapps/filament-passwordless-login - 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. spykapps/filament-passwordless-login

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

spykapps/filament-passwordless-login
====================================

A highly customizable Filament 4 plugin for passwordless magic link authentication with login page, actions, resource management, and analytics widgets.

v1.0.1(2mo ago)6205↓100%[2 issues](https://github.com/SpykApp/filament-passwordless-login/issues)MITPHPPHP ^8.1

Since Feb 25Pushed 2mo agoCompare

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

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

[![Screenshot](/art/fpl.jpeg)](/art/fpl.jpeg)

 [ ![Packagist Version](https://camo.githubusercontent.com/2968ec3719a5a3598db60e7342fc3fbc29dfcea11e733257d03b82ead68ca234/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370796b617070732f66696c616d656e742d70617373776f72646c6573732d6c6f67696e2e7376673f7374796c653d666f722d7468652d6261646765) ](https://packagist.org/packages/spykapps/filament-passwordless-login) [ ![Total Downloads](https://camo.githubusercontent.com/387b614ad26b5ad5a7ce0a063890860048b87d03933173de758737943a60792b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370796b617070732f66696c616d656e742d70617373776f72646c6573732d6c6f67696e2e7376673f7374796c653d666f722d7468652d6261646765) ](https://packagist.org/packages/spykapps/filament-passwordless-login) [![Laravel 12](https://camo.githubusercontent.com/5f32f51d9268f45b7376428e4a0bd33a004cdf420f9f92f2228a8e8a827a95e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31322e782d4646324432303f7374796c653d666f722d7468652d6261646765266c6f676f3d6c61726176656c)](https://laravel.com/docs/12.x) [![PHP 8.3](https://camo.githubusercontent.com/c373bf0b203812c0ee6eaa9d496d61fe5eeec0d2748786f6b95adc35c4dccdd1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332d3737374242343f7374796c653d666f722d7468652d6261646765266c6f676f3d706870)](https://php.net) [ ![License](https://camo.githubusercontent.com/608c8dfda488178950ce502d7697514db3a6a712579327ed90b9b594260f6355/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e7376673f7374796c653d666f722d7468652d6261646765) ](https://github.com/spykapps/filament-passwordless-login/blob/main/LICENSE.md)

Filament Passwordless Login
===========================

[](#filament-passwordless-login)

A highly customizable Filament 4 &amp; 5 plugin for passwordless (magic link) authentication — built on top of [`spykapps/passwordless-login`](https://github.com/SpykApp/passwordless-login).

Features
--------

[](#features)

- 🔐 **Magic Link Login Page** : Extends Filament's native login — no custom views needed
- ⚡ **Reusable Action** : Modal/slide-over action to send magic links from anywhere
- 💡 **Login Action** : Configurable as email field hint or button after login form
- 📊 **Resource Widgets** : Stats overview, line charts, and top users table on the resource page
- 🗂️ **Token Resource** : Full Filament resource to manage, generate, and invalidate tokens
- 🌍 **Multilingual** : 8 languages included (en, es, fr, de, nl, ar, hi, pt)
- 📧 **Custom Mailable / Notification** : Use your own email templates via fluent API
- ⚙️ **Fully Configurable** : Everything via plugin fluent API, config file, or language files

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12
- Filament 4.x, 5.x
- spykapps/passwordless-login ^1.0

---

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

[](#installation)

### 1. Install the packages

[](#1-install-the-packages)

```
composer require spykapps/filament-passwordless-login
```

This will also install `spykapps/passwordless-login` as a dependency.

### 2. Set up the base passwordless-login package

[](#2-set-up-the-base-passwordless-login-package)

If you haven't already set up the base package, publish and run the migrations:

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

> **Important:** The `passwordless_login_tokens` table must exist before using this plugin. If you've already run the migration, skip this step.

### 3. Add the trait to your User model

[](#3-add-the-trait-to-your-user-model)

```
use SpykApp\PasswordlessLogin\Traits\HasMagicLogin;

class User extends Authenticatable
{
    use HasMagicLogin;
}
```

### 4. Register the plugin

[](#4-register-the-plugin)

```
use SpykApp\FilamentPasswordlessLogin\FilamentPasswordlessLoginPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(
            FilamentPasswordlessLoginPlugin::make()
        );
}
```

That's it! The plugin will replace the login page, register the token resource with widgets.

### 5. Publish plugin config (optional)

[](#5-publish-plugin-config-optional)

```
php artisan vendor:publish --tag=filament-passwordless-login-config
```

### 6. Publish language files (optional)

[](#6-publish-language-files-optional)

```
php artisan vendor:publish --tag=filament-passwordless-login-lang
```

---

Plugin Configuration (Full Reference)
-------------------------------------

[](#plugin-configuration-full-reference)

All options can be set fluently in the plugin registration:

```
use SpykApp\FilamentPasswordlessLogin\FilamentPasswordlessLoginPlugin;
use SpykApp\FilamentPasswordlessLogin\Enums\FilamentPasswordlessLoginActionPosition;

FilamentPasswordlessLoginPlugin::make()

    // ── Login Page ──────────────────────────────────────
    ->loginPage()                                 // Enable magic link login (default: true)
    ->loginPage(false)                            // Disable — keep default Filament password login
    ->login(MyCustomLoginPage::class)             // Use your own custom login page class
    ->showPasswordLoginLink()                     // Show "Back to password login" link
    ->showPasswordLoginLink(false)                // Hide it

    // ── Redirect URLs ───────────────────────────────────
    ->redirectUrl('/admin/dashboard')             // Where to go after login (default: auto-detects panel URL)
    ->failureUrl('/admin/login')                  // Where to go on expired/invalid link (default: auto-detects panel login URL)

    // ── Login Action ────────────────────────────────────
    ->loginAction()                               // Enable login action (default: false)
    ->loginAction(false)                          // Disable
    ->loginActionPosition(                        // Where to show the action
        FilamentPasswordlessLoginActionPosition::EmailFieldHint      // As hint on email field
        // or
        FilamentPasswordlessLoginActionPosition::LoginFormEndButton  // As button after login form
    )
    ->loginActionIcon('heroicon-m-sparkles')      // Custom icon
    ->loginActionColor('warning')                 // Custom color

    // ── Action Modal ────────────────────────────────────
    ->slideover()                                 // Open action modal as slide-over
    ->slideover(false)                            // Open as centered modal (default)

    // ── Custom Mailable / Notification ──────────────────
    ->mailable(\App\Mail\MyMagicLinkMail::class)              // Custom mailable class
    ->notification(\App\Notifications\MyMagicLinkNotif::class) // Custom notification class

    // ── Resource ────────────────────────────────────────
    ->resource()                                  // Enable token resource (default: true)
    ->resource(false)                             // Disable
    ->canCreateTokens()                           // Allow manual token creation (default: true)
    ->canCreateTokens(false)                      // Disable create
    ->canDeleteTokens()                           // Allow deletion (default: true)
    ->canDeleteTokens(false)                      // Disable delete
    ->resourceSlug('magic-links')                 // Custom URL slug
    ->navigationGroup('Security')                 // Custom nav group (or use lang file)
    ->navigationIcon('heroicon-o-key')            // Custom nav icon
    ->navigationSort(50)                          // Custom sort order

    // ── Widgets (shown on resource page) ────────────────
    ->statsWidget()                               // Enable stats widget (default: true)
    ->statsWidget(false)                          // Disable
    ->chartsWidget()                              // Enable chart widgets (default: true)
    ->chartsWidget(false)                         // Disable
    ->chartDays(60)                               // Custom chart time range in days
```

### Configuration Priority

[](#configuration-priority)

Settings follow this priority order: **Plugin fluent API → Config file → Language file → Hardcoded default**

SettingPlugin APIConfigLangDefaultIcon`->loginActionIcon()``login_action.icon`—`heroicon-m-link`Color`->loginActionColor()``login_action.color`—`primary`Slideover`->slideover()``login_action.slideover`—`false`Nav Group`->navigationGroup()`—`navigation_group``Authentication`Nav Label——`navigation_label``Magic Links`Mailable`->mailable()`——Base package defaultNotification`->notification()`——Base package defaultRedirect URL`->redirectUrl()``passwordless-login.redirect.on_success`—`filament()->getUrl()`Failure URL`->failureUrl()``passwordless-login.redirect.on_failure`—`filament()->getLoginUrl()`---

Login Page
----------

[](#login-page)

The plugin extends Filament's native `Filament\Pages\Auth\Login` — **no custom views or Blade templates needed**.

The form shows only an email field. On submit, a magic link is sent and the page switches to a "Check your email!" confirmation state.

### Default Setup (replaces Filament login)

[](#default-setup-replaces-filament-login)

```
FilamentPasswordlessLoginPlugin::make()
    ->loginPage()
```

### Keep Password Login Available

[](#keep-password-login-available)

```
FilamentPasswordlessLoginPlugin::make()
    ->loginPage()
    ->showPasswordLoginLink()
```

### Disable (keep default Filament login)

[](#disable-keep-default-filament-login)

```
FilamentPasswordlessLoginPlugin::make()
    ->loginPage(false)
```

Redirect URLs
-------------

[](#redirect-urls)

By default, the plugin auto-detects redirect URLs from the current Filament panel — **no configuration needed** in most cases.

URLDefault (auto-detected)DescriptionRedirect URL`filament()->getUrl()` (e.g. `/admin`)Where the user goes after clicking the magic linkFailure URL`filament()->getLoginUrl()` (e.g. `/admin/login`)Where the user goes when a link is expired, invalid, or used### Override via Plugin

[](#override-via-plugin)

```
FilamentPasswordlessLoginPlugin::make()
    ->redirectUrl('/admin/dashboard')
    ->failureUrl('/admin/login?error=expired')
```

### Priority

[](#priority)

1. **Plugin fluent API** — `->redirectUrl()` / `->failureUrl()`
2. **Base package config** — `passwordless-login.redirect.on_success` / `on_failure`
3. **Auto-detected** — Current Filament panel URL / login URL

### Multi-Panel Setup

[](#multi-panel-setup)

Each panel automatically uses its own URLs. No extra configuration needed:

```
// Admin panel → redirects to /admin after login
class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->path('admin')
            ->plugin(FilamentPasswordlessLoginPlugin::make());
    }
}

// App panel → redirects to /app after login
class AppPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->path('app')
            ->plugin(FilamentPasswordlessLoginPlugin::make());
    }
}
```

### Explicit Per-Panel Redirect

[](#explicit-per-panel-redirect)

```
// Admin panel
FilamentPasswordlessLoginPlugin::make()
    ->redirectUrl('/admin/dashboard')
    ->failureUrl('/admin/login')

// App panel
FilamentPasswordlessLoginPlugin::make()
    ->redirectUrl('/app/home')
    ->failureUrl('/app/login')
```

### Custom Login Page

[](#custom-login-page)

Extend the plugin's login page:

```
