PHPackages                             benbjurstrom/plink - 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. benbjurstrom/plink

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

benbjurstrom/plink
==================

Secure One-Time Passwords For Laravel

v0.5.0(1y ago)2522MITPHPPHP ^8.2

Since Sep 29Pushed 1y ago3 watchersCompare

[ Source](https://github.com/benbjurstrom/plink)[ Packagist](https://packagist.org/packages/benbjurstrom/plink)[ Docs](https://github.com/benbjurstrom/plink)[ GitHub Sponsors](https://github.com/benbjurstrom)[ RSS](/packages/benbjurstrom-plink/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (12)Versions (6)Used By (0)

 [![Plink Screenshot](https://github.com/benbjurstrom/plink/raw/main/art/plink.png?raw=true)](https://github.com/benbjurstrom/plink/blob/main/art/plink.png?raw=true)

Passwordless Log-In Links for Laravel
=====================================

[](#passwordless-log-in-links-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/96b70d9414832f9a390d13f33643cb5f4b3c61372d86da338e98a34d80711946/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62656e626a75727374726f6d2f706c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/benbjurstrom/plink)[![GitHub Tests Action Status](https://camo.githubusercontent.com/659841a50e2996f03405fdfda08cbee3f9d41481cd7e3f21a9e436e8316f9132/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62656e626a75727374726f6d2f706c696e6b2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/benbjurstrom/plink/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/0138afd18f00e043dbc715e510bea9ad5e68b668935e990280f0330edf75fc7e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62656e626a75727374726f6d2f706c696e6b2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/benbjurstrom/plink/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)

This package provides full-featured passwordless log-in links for Laravel applications.

- ✅ Rate limited
- ✅ Invalidated after first use
- ✅ Locked to the user's session
- ✅ Configurable expiration
- ✅ Detailed error messages
- ✅ Customizable mail template
- ✅ Auditable logs

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

[](#installation)

### 1. Install the package via composer

[](#1-install-the-package-via-composer)

```
composer require benbjurstrom/plink
```

### 2. Add the package's interface and trait to your Authenticatable model

[](#2-add-the-packages-interface-and-trait-to-your-authenticatable-model)

```
// app/Models/User.php
namespace App\Models;

//...
use BenBjurstrom\Plink\Models\Concerns\HasPlinks;
use BenBjurstrom\Plink\Models\Concerns\Plinkable;

class User extends Authenticatable implements Plinkable
{
    use HasFactory, Notifiable, HasPlinks;

    // ...
}
```

### 3. Publish and run the migrations

[](#3-publish-and-run-the-migrations)

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

### 4. Add the package provided routes

[](#4-add-the-package-provided-routes)

```
// routes/web.php
Route::plinkRoutes();
```

### 5. (Optional) Publish the views for custom styling

[](#5-optional-publish-the-views-for-custom-styling)

```
php artisan vendor:publish --tag="plink-views"
```

This package publishes the following views:

```
resources/
└── views/
    └── vendor/
        └── plink/
            ├── error.blade.php
            ├── components/
                └── template.blade.php
            └── mail/
                ├── notification.blade.php
                └── plink.blade.php
```

### 6. (Optional) Publish the config file

[](#6-optional-publish-the-config-file)

```
php artisan vendor:publish --tag="plink-config"
```

This is the contents of the published config file:

```
