PHPackages                             envoisms/laravel-otp - 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. envoisms/laravel-otp

ActiveLibrary

envoisms/laravel-otp
====================

Laravel Notification Channel &amp; OTP Package for EnvoiSMS.ma

00PHPCI passing

Since Jul 23Pushed todayCompare

[ Source](https://github.com/FraudShield1/laravel-otp)[ Packagist](https://packagist.org/packages/envoisms/laravel-otp)[ RSS](/packages/envoisms-laravel-otp/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

EnvoiSMS Laravel OTP &amp; Notification Channel
===============================================

[](#envoisms-laravel-otp--notification-channel)

Official Laravel Notification Channel &amp; OTP Package for [EnvoiSMS.ma](https://envoisms.ma) — Morocco's SMS, WhatsApp &amp; Verification API platform.

For full API documentation, visit [EnvoiSMS Documentation](https://envoisms.ma/fr/docs).

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

[](#installation)

Install via Composer:

```
composer require envoisms/laravel-otp
```

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

[](#configuration)

Add your API credentials to `.env`:

```
ENVOISMS_API_KEY=your_api_key_here
ENVOISMS_FROM=MonBusiness
```

Optionally publish or add to `config/services.php`:

```
'envoisms' => [
    'api_key' => env('ENVOISMS_API_KEY'),
    'from' => env('ENVOISMS_FROM', 'EnvoiSMS'),
],
```

Usage in Laravel Notifications
------------------------------

[](#usage-in-laravel-notifications)

Create a notification class:

```
namespace App\Notifications;

use EnvoiSMS\Laravel\EnvoiSMSChannel;
use EnvoiSMS\Laravel\Messages\EnvoiSMSMessage;
use Illuminate\Notifications\Notification;

class SendOtpNotification extends Notification
{
    public function via($notifiable): array
    {
        return [EnvoiSMSChannel::class];
    }

    public function toEnvoiSMS($notifiable): EnvoiSMSMessage
    {
        return (new EnvoiSMSMessage())
            ->asOtp(brand: 'MonApp', codeLength: 6, expiry: 600);
    }
}
```

Send the notification to any model with a `phone` or `routeNotificationForEnvoiSMS()` method:

```
$user->notify(new SendOtpNotification());
```

Using the Facade Directly
-------------------------

[](#using-the-facade-directly)

```
use EnvoiSMS\Laravel\Facades\EnvoiSMS;

// Send OTP
$response = EnvoiSMS::sendOtp([
    'to' => '+212600000000',
    'brand' => 'MonApp',
]);

// Check OTP Code
$result = EnvoiSMS::checkOtp(
    sessionId: $response['session_id'],
    code: '123456'
);

if ($result['verified']) {
    // Code valid
}
```

Documentation
-------------

[](#documentation)

Full platform documentation is available at .

License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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://avatars.githubusercontent.com/u/205912850?v=4)[Abdelrhafar Naouri](/maintainers/FraudShield1)[@FraudShield1](https://github.com/FraudShield1)

---

Top Contributors

[![FraudShield1](https://avatars.githubusercontent.com/u/205912850?v=4)](https://github.com/FraudShield1 "FraudShield1 (2 commits)")

### Embed Badge

![Health badge](/badges/envoisms-laravel-otp/health.svg)

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

PHPackages © 2026

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