PHPackages                             scriptoshi/livewire-otp-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. scriptoshi/livewire-otp-auth

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

scriptoshi/livewire-otp-auth
============================

OTP authentication for Laravel with Livewire

1.0.4(4mo ago)0123MITPHPPHP ^8.2

Since Mar 14Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/scriptoshi/livewire-otp-auth)[ Packagist](https://packagist.org/packages/scriptoshi/livewire-otp-auth)[ RSS](/packages/scriptoshi-livewire-otp-auth/feed)WikiDiscussions main Synced today

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

Livewire OTP Authentication
===========================

[](#livewire-otp-authentication)

A simple and easy-to-use OTP (One-Time Password) Email authentication package for Laravel 12 using Livewire 3.

Features
--------

[](#features)

- OTP-based authentication for your Laravel application
- Simple email-based verification
- Support for login, registration, and email validation flows
- Rate limiting for OTP requests
- Customizable expiration times
- Responsive UI with live input validation using Flux components
- Easy integration with existing Laravel applications

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

[](#requirements)

- PHP 8.2+
- Laravel 12.x
- Livewire 3.x
- Flux 2.x

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

[](#installation)

You can install the package via composer:

```
composer require scriptoshi/livewire-otp-auth
```

This will automatically install Livewire and Flux if they're not already in your project.

After installing the package, you need to run the migrations:

```
php artisan migrate
```

This will add the necessary columns to your users table.

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

[](#configuration)

You can publish the configuration file:

```
php artisan vendor:publish --tag=livewire-otp-auth
```

This will create a `livewire-otp-auth.php` file in your `config` directory. You can modify the following settings:

- **expiration\_time**: How long an OTP is valid for in minutes (default: 10)
- **otp\_length**: The length of the OTP code (default: 6)
- **resend\_cooldown**: Cooldown time in seconds before a user can request another OTP (default: 60)
- **rate\_limit\_attempts**: Number of OTP attempts before rate limiting is applied (default: 5)
- **rate\_limit\_duration**: Duration in minutes for which rate limiting is applied (default: 5)

Usage
-----

[](#usage)

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

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

First, add the `HasOtpAuth` trait to your User model:

```
use Scriptoshi\LivewireOtpAuth\Traits\HasOtpAuth;

class User extends Authenticatable
{
    use HasOtpAuth;

    // ...
}
```

### 2. Make sure Flux is properly set up

[](#2-make-sure-flux-is-properly-set-up)

If you haven't already set up Flux in your project, follow the [official Flux documentation](https://github.com/livewire/flux) to make sure it's properly configured.

### 3. Add the component to your views

[](#3-add-the-component-to-your-views)

You can now add the OTP authentication component to your views:

```

```

By default, this will use the `login` type and the `request` step. You can customize this by passing parameters:

```

```

Available types:

- `login`: For existing users (default)
- `register`: For new users (requires a name field)
- `validate`: For validating emails of logged-in users

### 4. Customizing the UI

[](#4-customizing-the-ui)

If you want to customize the UI, you can publish the views:

```
php artisan vendor:publish --tag=livewire-otp-auth
```

Then you can edit the views in `resources/views/vendor/livewire-otp-auth`.

### 5. Configure Tailwind CSS

[](#5-configure-tailwind-css)

To ensure that Tailwind CSS properly processes the component styles, add this package to your content sources in your CSS file (typically `resources/css/app.css`):

```
/* Add this line with your other @source directives */
@source '../../vendor/scriptoshi/livewire-otp-auth/resources/views/**/*.blade.php';
```

For example, your CSS file might look similar to this:

```
@import "tailwindcss";
@source "../views";
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../vendor/scriptoshi/livewire-otp-auth/resources/views/**/*.blade.php';
/* Rest of your CSS file */
```

### 6. Flux Components

[](#6-flux-components)

This package uses Flux components to provide a consistent and beautiful UI. The components include:

- `flux:input` - Used for email and name inputs
- `flux:button` - Used for action buttons

These components automatically inherit your application's theme and styling, providing a seamless integration with your Laravel application.

Routes
------

[](#routes)

The package automatically registers a route for verifying OTPs via email links:

```
GET /otp/verify/{code}

```

This route is named `otp.verify` and can be used to verify OTPs sent via email.

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance74

Regular maintenance activity

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~83 days

Total

5

Last Release

143d ago

### Community

Maintainers

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

---

Top Contributors

[![ofumbi](https://avatars.githubusercontent.com/u/4081256?v=4)](https://github.com/ofumbi "ofumbi (5 commits)")[![scriptoshi](https://avatars.githubusercontent.com/u/189149148?v=4)](https://github.com/scriptoshi "scriptoshi (1 commits)")

### Embed Badge

![Health badge](/badges/scriptoshi-livewire-otp-auth/health.svg)

```
[![Health](https://phpackages.com/badges/scriptoshi-livewire-otp-auth/health.svg)](https://phpackages.com/packages/scriptoshi-livewire-otp-auth)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M131](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

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

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725172.4k14](/packages/tallstackui-tallstackui)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)

PHPackages © 2026

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