PHPackages                             rabyte/laravel-passkeys - 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. rabyte/laravel-passkeys

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

rabyte/laravel-passkeys
=======================

Use passkeys in your Laravel app

01PHP

Since Nov 18Pushed 1y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

**THIS PACKAGE IS IN DEVELOPMENT, DO NOT USE (YET)**

Use passkeys in your Laravel app
================================

[](#use-passkeys-in-your-laravel-app)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0ca167a0f495233f7af4e9adcf2b5df529a69fec2f9f1c61a37af6d52621c0e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d706173736b6579732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-passkeys)[![GitHub Tests Action Status](https://camo.githubusercontent.com/3961e06c6c3ee2619dcfad62dad50ae9a2b45a5f42d029545b0d73cae0e04ae2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d706173736b6579732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/spatie/laravel-passkeys/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/cf32402e4a4d7605c38804684f03bac4c1573690fc4124ed5f1be71c3e771d9f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d706173736b6579732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/spatie/laravel-passkeys/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/50a78ad815aa2da2eff3d4ea3a1956db5204c898f904705194e7907f4d3930f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d706173736b6579732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-passkeys)

Passkeys let you log in without needing a password. The process can be compared to how SSH keys work.

A passkey is a unique key pair that is generated by a password manager or hardware security key. One key is public and stored on in your Laravel app, and the other is private and stored in the password manager.

When logging using a passkey, the Laravel app will generate a challenge that your password manager can solve using the stored private key. The password manager will create a secure response and sends it back to Laravel app. If the challenge is solved correctly, you're logged in.

You can learn more about how passkeys work [here](https://www.dashlane.com/blog/what-is-a-passkey-and-how-does-it-work#).

This package provides a simple way to generate passkey using a Livewire component. It also contains a Blade component that can authenticate using passkeys.

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/926a9bd54e0f4c0be599c83de349801aefb65aaa580d295a61c8f8f134a09bcd/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d706173736b6579732e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-passkeys)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

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

[](#requirements)

This package contains a Livewire component to generate passkeys. Make sure you have Livewire installed in your Laravel app.

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

[](#installation)

You can install the package via composer:

```
composer require spatie/laravel-passkeys
```

Next, you must set the `AUTH_MODEL` in your `.env` file to the class name of the model that should be authenticated using passkeys.

```
AUTH_MODEL=App\Models\User
```

Next, you publish the migration by the package with:

```
php artisan vendor:publish --tag="passkeys-migrations"
```

After the migration has been published you can create the `passkeys` table by running the migrations:

```
php artisan migrate
```

Optionally, you can publish the config file using:

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

This is the contents of the published config file:

```
return [
    /*
     * After a successful authentication attempt using a passkey
     * we'll redirect to this URL.
     */
    'redirect_to_after_login' => '/dashboard',

    /*
     * These class are responsible for performing core tasks regarding passkeys.
     * You can customize them by creating a class that extends the default, and
     * by specify your custom class name here
     */
    'actions' => [
        'generate_passkey_register_options' => Spatie\LaravelPasskeys\Actions\GeneratePasskeyRegisterOptionsAction::class,
        'store_passkey' => Spatie\LaravelPasskeys\Actions\StorePasskeyAction::class,
        'generate_passkey_authentication_options' => \Spatie\LaravelPasskeys\Actions\GeneratePasskeyAuthenticationOptionsAction::class,
        'find_passkey' => \Spatie\LaravelPasskeys\Actions\FindPasskeyToAuthenticateAction::class,
    ],

    /*
     * These properties will be used to generate the passkey.
     */
    'relying_party' => [
        'name' => config('app.name'),
        'id' => parse_url(config('app.url'), PHP_URL_HOST),
        'icon' => null,
    ],

    /*
     * The models used by the package.
     * You can override this by specifying your own models
     */
    'models' => [
        'passkey' => Spatie\LaravelPasskeys\Models\Passkey::class,
        'authenticatable' => env('AUTH_MODEL', App\Models\User::class),
    ],
];
```

Optionally, you can publish the views using

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

Usage
-----

[](#usage)

There are two parts to using passkeys in your Laravel app: creating a passkey and authenticating using a passkey.

### Creating a passkey

[](#creating-a-passkey)

The package provides a Livewire component to generate a passkey. It is able to create a passkey for the currently logged in user. It will also show all generated passkeys.

You can include this component in your views.

```

```

Here's how the component looks like:

// TODO: insert image

### Authenticating using a passkey

[](#authenticating-using-a-passkey)

To let your users authenticate using a passkey, you can include the `authenticate-passkey` Blade component in your view, typically on your login view.

```

```

// TODO: insert image

This component will show a link that, when clicked, will start the passkey authentication process.

If the authentication is successful, the user will be redirected to the URL specified in the `redirect_to_after_login` key of the `passkeys` config file.

#### Customizing the look and feel of the component

[](#customizing-the-look-and-feel-of-the-component)

To customize the look and feel of the component, you can pass HTML to the component.

```

    Authenticate using passkey

```

To customize where the user is redirected after a successful login, you can pass a URL to the `redirect` prop of component.

```

```

### Events

[](#events)

The package fires the `Spatie\LaravelPasskeys\Events\PasskeyUsedToAuthenticateEvent` when a passkey is used to authenticate. It has a property `passkey` that contains the `Passkey` model that was used to authenticate.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

This code is based on the [Laracast course on passkeys](https://laracasts.com/series/add-passkeys-to-a-laravel-app) by the amazing [Luke Downing](https://github.com/lukeraymonddowning).

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 95.8% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/39e8050bd1d00bc889aa04cfc45b35b729c05b18fcf605c964de580ef797d1af?d=identicon)[rabytebuild](/maintainers/rabytebuild)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (68 commits)")[![jhg](https://avatars.githubusercontent.com/u/1288711?v=4)](https://github.com/jhg "jhg (1 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (1 commits)")[![rabiuhadisalisu](https://avatars.githubusercontent.com/u/94430863?v=4)](https://github.com/rabiuhadisalisu "rabiuhadisalisu (1 commits)")

### Embed Badge

![Health badge](/badges/rabyte-laravel-passkeys/health.svg)

```
[![Health](https://phpackages.com/badges/rabyte-laravel-passkeys/health.svg)](https://phpackages.com/packages/rabyte-laravel-passkeys)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M119](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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