PHPackages                             akibatech/laravel-ovh-sms - 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. [API Development](/categories/api)
4. /
5. akibatech/laravel-ovh-sms

ActiveLibrary[API Development](/categories/api)

akibatech/laravel-ovh-sms
=========================

The OVH Sms Api integration for Laravel 5.

1.1.5(9y ago)78033[1 issues](https://github.com/MarceauKa/laravel-ovh-sms/issues)MITPHPPHP &gt;=5.5.9

Since Feb 16Pushed 9y ago2 watchersCompare

[ Source](https://github.com/MarceauKa/laravel-ovh-sms)[ Packagist](https://packagist.org/packages/akibatech/laravel-ovh-sms)[ RSS](/packages/akibatech-laravel-ovh-sms/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Laravel OVH SMS
===============

[](#laravel-ovh-sms)

This is an unofficial integration of the [php-ovh-sms](https://github.com/ovh/php-ovh-sms) library for Laravel 5.

- Original [PHP OVH SMS library](https://github.com/ovh/php-ovh-sms/blob/master/README.md)
- Plans &amp; pricing (20 free credits) on the [official site](https://www.ovhtelecom.fr/sms/)
- Getting credentials on the [OVH Api Explorer](https://api.ovh.com/createToken/index.cgi?GET=/sms&GET=/sms/*&PUT=/sms/*&DELETE=/sms/*&POST=/sms/*)

Summary
-------

[](#summary)

- [Installation](#installation)
- [Usage](#usage)
    - [Package API workflow](#package-api-workflow)
    - [Original API workflow](#original-api-workflow)
- [Using with Laravel Notifications](#using-with-laravel-notifications)
    - [Example notification](#example-notification)
- [Getting credentials](#getting-credentials)
- [Support](#support)
- [Licence](#licence)

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

[](#installation)

Require this package with composer:

```
composer require akibatech/laravel-ovh-sms
```

After updating composer, add the ServiceProvider to the **providers** array in config/app.php:

```
Akibatech\Ovhsms\ServiceProvider::class,
```

If you want to use the Facade for rapid message sending, you can add this line to your config/app.php in the **aliases** section:

```
'Ovhsms' => Akibatech\Ovhsms\Facade::class,
```

Then, you should publish the **laravel-ovh-sms** to your config folder with the following command.

```
php artisan vendor:publish --provider="Akibatech\Ovhsms\ServiceProvider"
```

Usage
-----

[](#usage)

Send a message (using Facade) anywhere in your app:

```
Ovhsms::sendMessage('+33611223344', 'Hello!');
```

Send a message in a controller using DI:

```
public function myControllerAction(Akibatech\Ovhsms\OvhSms $client)
{
    $client->sendMessage('+33611223344', 'Hello!');
}
```

### Package API workflow

[](#package-api-workflow)

This package give you an access to a ready to use **Ovh\\Sms\\SmsApi** instance with your configured credentials and your default sms account (if present).

It also offer some helpers over the original Api.

```
$client = app('ovhsms');

// Prepare a new SMS instance and return it.
$sms = $client->newMessage('the phone number');
$sms->send('Hi!');

// Same as above but the SMS is marked as a marketing message.
$sms = $client->newMarketingMessage($phone); // Alias of newMessage($phone, true);
$sms->send('Hello!');

// Attach many receivers
$sms = $client->newMessage(['phone1', 'phone2'], ...);
$sms->send('Hi guys!');

// Send directly the message
$client->sendMessage($phone, 'Hello!');
// Or
$client->sendMarketingMessage($phone, 'Super price this sunday!');
```

### Original API workflow

[](#original-api-workflow)

If you don't want to use ready-to-use helpers, you can follow the original workflow. Here's an example:

```
// Retrieve OVH SMS instance
$ovhsms = app('ovhsms'); // Or Ovhsms::getClient();

// Get available SMS accounts
$accounts = $ovhsms->getAccounts();

// Set the account you will use
$ovhsms->setAccount($accounts[0]);

// Create a new message that will allow the recipient to answer (to FR receipients only)
$sms = $ovh->createMessage(true);
$sms->addReceiver("+33601020304");
$sms->setIsMarketing(false);

// Plan to send it in the future
$sms->setDeliveryDate(new DateTime("2018-02-25 18:40:00"));
$sms->send("Hello world!");
```

Using with Laravel Notifications
--------------------------------

[](#using-with-laravel-notifications)

This package can be used as a driver for Laravel Notifications (Laravel &gt;= 5.3).

### Example notification

[](#example-notification)

Here's a simple notification example.

```
namespace App\Notifications;

use Akibatech\Ovhsms\Notifications\OvhSmsChannel;
use Akibatech\Ovhsms\Notifications\OvhSmsMessage;
use Illuminate\Notifications\Notification;

class ExampleNotification extends Notification
{
    /**
     * Notification via OvhSmsChannel.
     */
    public function via($notifiable)
    {
        return [OvhSmsChannel::class];
    }

    /**
     * Your notification must implements "toOvh()"
     */
    public function toOvh($notifiable)
    {
    	return (new OvhSmsMessage('A new invoice was paid! Amount: $9.00'));
    }
}
```

Also, your Notifiable model must implements **routeNotificationForOvh()**.

```
namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * Returns the user's phone number.
     */
    public function routeNotificationForOvh()
    {
        return $this->phone; // Ex: +33611223344
    }
}
```

Nice, you're ready to use the new Laravel Notifications system.

Getting credentials
-------------------

[](#getting-credentials)

You can get your credentials from the [official API Explorer site](https://api.ovh.com/createToken/index.cgi?GET=/sms&GET=/sms/*&PUT=/sms/*&DELETE=/sms/*&POST=/sms/*) at OVH.

Once your credentials in hands, you need to put them in **config/laravel-ovh-sms.php**.
For convenience, you can put them in your .env file.

Config keys are:

- OVHSMS\_APP\_KEY =&gt; your application key
- OVHSMS\_APP\_SECRET =&gt; your application secret
- OVHSMS\_CONSUMER\_KEY =&gt; your consumer key
- OVHSMS\_ENDPOINT =&gt; your endpoint (defaults to ovh-eu)

Optional keys:

- OVHSMS\_ACCOUNT =&gt; your sms account ID (formatted like "sms-LLXXXXX-X")
- OVHSMS\_USER\_LOGIN =&gt; your API user ID
- OVHSMS\_SENDER =&gt; phone number or alphanumeric sender designation

Support
-------

[](#support)

Issues related to **ovh/php-ovh-sms** should be posted on [its own repo](https://github.com/ovh/php-ovh-sms).
For this Laravel package, feel free to post your issues in the issues section.

Contributors
------------

[](#contributors)

- [MarceauKa](https://github.com/AkibaTech)
- [bastien09](https://github.com/bastien09)

Licence
-------

[](#licence)

MIT

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

3421d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1665333?v=4)[Marceau Casals](/maintainers/MarceauKa)[@MarceauKa](https://github.com/MarceauKa)

---

Top Contributors

[![MarceauKa](https://avatars.githubusercontent.com/u/1665333?v=4)](https://github.com/MarceauKa "MarceauKa (19 commits)")[![AkibaTech](https://avatars.githubusercontent.com/u/82867646?v=4)](https://github.com/AkibaTech "AkibaTech (2 commits)")

---

Tags

laravellaravel-notificationslaravel-packageovhapilaravelsmslaravel5ovh

### Embed Badge

![Health badge](/badges/akibatech-laravel-ovh-sms/health.svg)

```
[![Health](https://phpackages.com/badges/akibatech-laravel-ovh-sms/health.svg)](https://phpackages.com/packages/akibatech-laravel-ovh-sms)
```

###  Alternatives

[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.5k](/packages/ardakilic-mutlucell)

PHPackages © 2026

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