Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Jusibe Laravel Package

laravel-notification-channels/jusibe

A Laravel notification channel for sending SMS messages through Jusibe. Integrate Jusibe’s SMS API with Laravel’s notification system to deliver transactional or alert messages to users via a simple, familiar channel.

View on GitHub
Deep Wiki
Context7

Getting Started

Install and configure

composer require laravel-notification-channels/jusibe
php artisan vendor:publish --provider="NotificationChannels\Jusibe\JusibeServiceProvider"

The package ships a config file (typically config/jusibe.php or a jusibe block in config/services.php) holding your Jusibe public key, secret key, and default sender ID. Wire those to .env:

JUSIBE_PUBLIC_KEY=...
JUSIBE_SECRET_KEY=...
JUSIBE_SENDER_ID=MyApp

Open src/JusibeChannel.php and src/JusibeMessage.php first — the package is small (a channel plus a message DTO), so the source is the documentation. Confirm the exact config keys and method names against the version you install, since the README for a 2020-era Laravel 5.3 package is often thinner than the code.

First use case: transactional SMS (OTP, alerts)

  1. Make your model notifiable and give it a routing method:
public function routeNotificationForJusibe()
{
    return $this->phone; // normalised, see Gotchas
}
  1. Generate a notification and add the channel:
use NotificationChannels\Jusibe\JusibeChannel;
use NotificationChannels\Jusibe\JusibeMessage;

public function via($notifiable)
{
    return [JusibeChannel::class];
}

public function toJusibe($notifiable)
{
    return (new JusibeMessage())
        ->content("Your verification code is {$this->code}");
}
  1. Send it: $user->notify(new VerifyPhone($code));

If toJusibe() is missing or returns something other than a JusibeMessage, Laravel throws — there is no silent fallback.

Implementation Patterns

On-demand notifications (no user model yet)

Perfect for pre-registration OTPs:

Notification::route('jusibe', '2348012345678')
    ->notify(new SendOtp($code));

Use the channel's route key (jusibe) so Laravel resolves the phone number without a Notifiable model.

Always queue

SMS gateways are slow and flaky; make notifications implement ShouldQueue. Combine with ->onQueue('sms') so a Jusibe outage or latency spike never blocks a web request.

class VerifyPhone extends Notification implements ShouldQueue
{
    public $tries = 3;
    public $backoff = [10, 60];
}

Centralise message construction

Avoid rebuilding content strings in every notification. Add a small helper or base notification that formats the body, so a template change (e.g. adding "Do not share this code") happens in one place.

protected function sms(string $body): JusibeMessage
{
    return (new JusibeMessage())->content($body);
}

Per-message sender override

If JusibeMessage exposes a from()/sender setter, use it for multi-brand apps (one sender ID per product). Otherwise set the default sender in config and keep a single approved sender per environment.

Fan-out to multiple recipients

For a group alert, loop and dispatch on-demand notifications, chunking the list so you stay within Jusibe's rate limits and your queue worker remains responsive. Do not attempt to reuse one message object across recipients with different to() values in a loop unless the DTO is immutable — re-instantiate per send.

Test with Notification::fake()

Notification::fake();
$user->notify(new VerifyPhone('1234'));

Notification::assertSentTo($user, VerifyPhone::class, function ($n, $channels) {
    return in_array(JusibeChannel::class, $channels);
});

This verifies your wiring without touching Jusibe. For a genuine integration test, mock the underlying HTTP client (see Gotchas) rather than hitting the live API in CI.

Gotchas and Tips

This package is effectively unmaintained. Last release April 2020, 8 stars, 0 dependents. It targets Laravel 5.3. Check composer.json constraints before installing on Laravel 8/9/10/11 — you may need --ignore-platform-reqs, a fork, or a 30-line custom channel. Given how small the surface area is, forking and pinning to your app is often safer than depending on the abandoned tag.

Phone number format is the #1 failure mode. Normalise before handing it to the channel: strip spaces, +, and dashes, and convert local Nigerian format (0801...) to international without the plus (234801...). Do this in a mutator or in routeNotificationForJusibe(), never trust user input. A malformed number often returns a Jusibe-level error body with HTTP 200, which the channel may not surface as an exception.

200 OK does not mean delivered. Jusibe's API returns a JSON body with a status field; a rejected sender ID or insufficient credits can come back as an error inside an apparently successful response. Read JusibeChannel's response handling carefully and add your own logging around sends, or wrap it — otherwise failures vanish into your queue's "succeeded" pile.

Sender IDs need approval. Alphanumeric sender IDs (max ~11 chars) must be registered/whitelisted with Jusibe before use. In dev, use whatever sandbox sender they provide; ship the approved one via JUSIBE_SENDER_ID.

Message length and encoding. GSM-7 fits 160 characters; any non-GSM character (smart quotes, emoji, accented names) forces UCS-2 at 70 characters per segment. Jusibe bills per segment. Strip curly quotes from templates and keep OTP messages under 160 characters.

Config caching. After php artisan config:cache, env() calls inside the package config won't re-read .env. Make sure JUSIBE_* vars are set in the deployed environment before caching, or you'll send with empty credentials and get opaque failures.

Mocking in tests. If the package uses Guzzle directly (likely, given its age), Http::fake() won't intercept it. Use a Guzzle MockHandler on the client instance you bind into the container, or bind a fake Jusibe client wrapper in a service provider and test against that.

No delivery receipts or inbound SMS. The package is fire-and-forget; there is no webhook handler, DLR parsing, or two-way SMS. If you need delivery confirmation, you must build a controller for Jusibe's callback and reconcile by message ID yourself.

No rate limiting built in. Implement a RateLimited middleware on the queued notification or use Redis::throttle in a job wrapper. Bursting OTP traffic during signup campaigns is the classic way to get throttled by the gateway.

Extend rather than edit. If you need retries, logging, or response validation, subclass JusibeChannel (or write your own SmsChannel around the Jusibe HTTP API) and register it in via(). Keep the vendor directory clean so a fork or replacement stays a drop-in swap.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource