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

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

parvezmia/laravel-passwordless-auth
===================================

A secure, user-friendly Laravel package for passwordless authentication via magic links

v1.2.0(1y ago)29[3 PRs](https://github.com/ParvezMia/laravel-passwordless-auth/pulls)MITPHPPHP ^8.0CI passing

Since Apr 5Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/ParvezMia/laravel-passwordless-auth)[ Packagist](https://packagist.org/packages/parvezmia/laravel-passwordless-auth)[ Docs](https://github.com/ParvezMia/laravel-passwordless-auth)[ GitHub Sponsors](https://github.com/:vendor_name)[ RSS](/packages/parvezmia-laravel-passwordless-auth/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (5)Versions (9)Used By (0)

Laravel Passwordless Authentication
===================================

[](#laravel-passwordless-authentication)

A simple, secure passwordless authentication system for Laravel applications. This package provides a complete solution for implementing magic link authentication in your Laravel projects.

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

[](#installation)

You can install the package via composer:

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

Configuration
-------------

[](#configuration)

After installation, publish the package assets:

```
php artisan vendor:publish --provider="ParvezMia\LaravelPasswordlessAuth\PasswordlessAuthServiceProvider"
```

This will publish:

- Configuration file
- Migration file
- View templates
- Route definitions

### Configuration Options

[](#configuration-options)

The published configuration file (`config/passwordless-auth.php`) contains the following options:

```
return [
    // Time in minutes before a login token expires
    'token_expiration' => 15,

    // Where to redirect users after successful login
    'redirect_on_login' => '/dashboard',

    // Length of the generated security token
    'token_length' => 64,

    // User model to use for authentication
    'user_model' => \App\Models\User::class,

    // Field to use as login identifier (typically email)
    'login_identifier' => 'email',

    // Email template for login links
    'email_view' => 'passwordless-auth::emails.login-link',
];
```

Database Setup
--------------

[](#database-setup)

Run the migrations to create the necessary database tables:

```
php artisan migrate
```

This creates a `login_tokens` table to store the temporary login tokens.

Queue Configuration
-------------------

[](#queue-configuration)

This package uses Laravel's queue system to send emails asynchronously for better performance. To configure the queue:

1. Set up your preferred queue driver in your .env file:

```
QUEUE_CONNECTION=database

```

2. If using the database driver, run the queue migration:

```
php artisan queue:table
php artisan migrate

```

3. Start the queue worker:

```
php artisan queue:work

```

Route Integration
-----------------

[](#route-integration)

To include the passwordless authentication routes in your application, add the following line to your `routes/web.php` file:

```
require __DIR__.'/passwordless-auth.php';
```

Available Routes
----------------

[](#available-routes)

The package provides the following routes:

MethodURINameDescriptionGET/login/passwordlesspasswordless.loginDisplays the login formPOST/login/passwordlesspasswordless.sendProcesses the login request and sends linkGET/login/passwordless/verify/{token}passwordless.verifyVerifies token and logs user inPOST/logoutpasswordless.logoutLogs the user outEmail Configuration
-------------------

[](#email-configuration)

For the email functionality to work properly, ensure your Laravel application has proper email configuration in your `.env` file:

```
MAIL_MAILER=smtp
MAIL_HOST=your-smtp-host
MAIL_PORT=587
MAIL_USERNAME=your-username
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=your-email@example.com
MAIL_FROM_NAME="${APP_NAME}"

```

Customization
-------------

[](#customization)

### Publishing Specific Components

[](#publishing-specific-components)

You can publish specific components of the package:

```
# Publish only configuration
php artisan vendor:publish --provider="ParvezMia\LaravelPasswordlessAuth\PasswordlessAuthServiceProvider" --tag="config"

# Publish only migrations
php artisan vendor:publish --provider="ParvezMia\LaravelPasswordlessAuth\PasswordlessAuthServiceProvider" --tag="migrations"

# Publish only views
php artisan vendor:publish --provider="ParvezMia\LaravelPasswordlessAuth\PasswordlessAuthServiceProvider" --tag="views"

# Publish only routes
php artisan vendor:publish --provider="ParvezMia\LaravelPasswordlessAuth\PasswordlessAuthServiceProvider" --tag="routes"

# Publish only email-related files
php artisan vendor:publish --provider="ParvezMia\LaravelPasswordlessAuth\PasswordlessAuthServiceProvider" --tag="email"

# Publish only controllers
php artisan vendor:publish --provider="ParvezMia\LaravelPasswordlessAuth\PasswordlessAuthServiceProvider" --tag="controllers"

# Publish only models
php artisan vendor:publish --provider="ParvezMia\LaravelPasswordlessAuth\PasswordlessAuthServiceProvider" --tag="models"

# Publish all components at once
php artisan vendor:publish --provider="ParvezMia\LaravelPasswordlessAuth\PasswordlessAuthServiceProvider" --tag="all"
```

### Customizing Views

[](#customizing-views)

After publishing the views, you can customize them in `resources/views/vendor/passwordless-auth/`.

Usage Examples
--------------

[](#usage-examples)

### Adding Login Link to Your Application

[](#adding-login-link-to-your-application)

```
Login without password
```

### Adding Logout Button

[](#adding-logout-button)

```

    @csrf
    Logout

```

### Login Flow

[](#login-flow)

1. User visits the login page and enters their email address
2. A unique, secure token is generated and stored in the database
3. An email with a login link containing the token is sent to the user
4. User clicks the link in their email
5. The token is verified and the user is automatically logged in
6. The token is deleted to prevent reuse

Troubleshooting
---------------

[](#troubleshooting)

### Email Issues

[](#email-issues)

If emails are not being sent:

1. Check your Laravel log files for errors: `storage/logs/laravel.log`
2. Verify your mail configuration in `.env`
3. Try using the log mail driver for testing: `MAIL_MAILER=log`
4. Ensure the user model has the `Notifiable` trait
5. Clear config cache: `php artisan config:clear`

### Route Issues

[](#route-issues)

If routes are not working:

1. Make sure you've included the routes file in your `web.php`
2. Clear route cache: `php artisan route:clear`
3. Check for route conflicts with `php artisan route:list`

Security Considerations
-----------------------

[](#security-considerations)

- Login tokens expire after the configured time (default: 15 minutes)
- Tokens are single-use and are deleted after successful login
- Tokens are stored securely in the database with a unique constraint
- The package uses Laravel's built-in CSRF protection

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance67

Regular maintenance activity

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61.1% 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 ~0 days

Total

4

Last Release

455d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66371168?v=4)[ParvezMia](/maintainers/ParvezMia)[@ParvezMia](https://github.com/ParvezMia)

---

Top Contributors

[![ParvezMia](https://avatars.githubusercontent.com/u/66371168?v=4)](https://github.com/ParvezMia "ParvezMia (11 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

laravelAuthenticationPasswordlessmagic-linksecure-loginpasswordless-authemail-authentication

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M201](/packages/laravel-ai)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[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.

45444.2k1](/packages/pressbooks-pressbooks)[masterix21/laravel-licensing

Laravel licensing package with polymorphic assignment to any model, activation keys, expirations/renewals, and seat control via LicenseUsage. Supports offline verification with public-key–signed tokens, a CLI to generate/rotate/revoke keys, and an extensible architecture via config and contracts.

1563.2k4](/packages/masterix21-laravel-licensing)

PHPackages © 2026

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