PHPackages                             husnet/laravel-smsup.ch - 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. husnet/laravel-smsup.ch

ActiveLibrary[API Development](/categories/api)

husnet/laravel-smsup.ch
=======================

Laravel package to provide SmsUp.ch API integration.

V1.0.0(4y ago)08MITPHPPHP &gt;=7.3|^8.0

Since Jun 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Husnet/LaravelSmsUpCh)[ Packagist](https://packagist.org/packages/husnet/laravel-smsup.ch)[ RSS](/packages/husnet-laravel-smsupch/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

SmsUp.ch API Integration for Laravel 8+
=======================================

[](#smsupch-api-integration-for-laravel-8)

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

[](#installation)

### Install Package

[](#install-package)

You can install this package via composer:

```
composer require husnet/laravel-smsupch
```

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

[](#configuration)

Add your SmsUp API key to your `config/services.php` file:

```
return [
    ...
    ...
    'smsUpCh' => [
         'token' => env('SMSUPCH_TOKEN'),
         'simulate' => env('SMSUPCH_SIMULATE'), // true or false
         'sender' => env('SMSUPCH_SENDER_NAME', config('app.name')),
    ]
    ...
];
```

Set `simulate` to `true` if you want to simulate submitting messages, it's perfect for testing and debugging, it has no cost.

Usage
-----

[](#usage)

### Using Laravel Notification

[](#using-laravel-notification)

Use artisan to create a notification:

```
php artisan make:notification someNotification
```

Return `[smsUpCh]` in the `public function via($notifiable)` method of your notification:

```
public function via($notifiable)
{
    return ['smsUpCh'];
}
```

Add the method `public function toSmsUp($notifiable)` to your notification, and return an instance of `SmsUpChMessage`:

```
use Husnet\LaravelSmsUpCh\SmsUpChMessage;
...
public function toSmsUpCh($notifiable)
{
    $message = new SmsUpChMessage();
    $message->text($this->text);
    return $message;
}
```

If you don't indicate the parameter `to`, make sure your notifiable entity has `routeNotificationForSmsUpCh` method defined:

```
/**
 * Route notifications for the SmsUp channel.
 *
 * @return string
 */
public function routeNotificationForSmsUpCh(): string
{
    return $this->phone;
}
```

### Using SmsUp Facade

[](#using-smsup-facade)

#### Send messages

[](#send-messages)

```
use Husnet\LaravelSmsUpCh\SmsUpChMessage;
use Husnet\LaravelSmsUpCh\Facades\SmsUpCh;
...
    try {
        $phone_owner->notify(new ClientNotification($message_text));
    }
    catch (\Exception $e) {
        session()->flash('error', __('Error: SMS API Timeout'));
    }
```

Available Events
----------------

[](#available-events)

LaravelSmsUp comes with handy events which provides the required information about the SMS messages.

### Messages Was Sent

[](#messages-was-sent)

Triggered when one or more messages are sent.

Example:

```
use Husnet\LaravelSmsUpCh\Events\SmsUpChMessageWasSent;

class SmsUpMessageSentListener
{
    /**
     * Handle the event.
     *
     * @param  SmsUpChMessageWasSent  $event
     * @return void
     */
    public function handle(SmsUpChMessageWasSent $event)
    {
        $response = $event->response; // Class SmsUpResponse
        $message = $event->message; // Class SmsUpMessage

        // flashing to session
        session()->flash('message.to', $message->getTo());
        session()->flash('message.text', $message->getText());

        session()->flash('response.status', $response->getStatus());
        session()->flash('response.message', $response->getMessage());
        session()->flash('response.credits', $response->getCredits());
        session()->flash('response.invalid', $response->getInvalid());

    }
}
```

In your `EventServiceProvider`:

```
protected $listen = [
        ...
        'Husnet\LaravelSmsUpCh\Events\SmsUpChMessageWasSent' => [
            'App\Listeners\SmsUpChMessageSentListener',
        ],
    ];
```

SmsUp.ch API Documentation
--------------------------

[](#smsupch-api-documentation)

Visit [SmsUp.ch API Documentation](https://doc.smsup.ch/) for more information.

Support
-------

[](#support)

Feel free to post your issues in the issues section.

Credits
-------

[](#credits)

- [Gaétan Huser](https://github.com/husnet)
- [All Contributors](../../contributors)
- [Inspired by Squareetlabs/LaravelSmsUp](https://github.com/squareetlabs/LaravelSmsUp)

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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 ~4 days

Total

2

Last Release

1793d ago

Major Versions

V0.1 → V1.0.02021-06-14

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/husnet-laravel-smsupch/health.svg)

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

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[ashallendesign/laravel-exchange-rates

A wrapper package for interacting with the exchangeratesapi.io API.

485677.8k](/packages/ashallendesign-laravel-exchange-rates)[nickurt/laravel-postcodeapi

Universal PostcodeApi for Laravel 11.x/12.x/13.x

97221.2k](/packages/nickurt-laravel-postcodeapi)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[spinen/laravel-clickup

SPINEN's Laravel Package for ClickUp.

282.2k](/packages/spinen-laravel-clickup)

PHPackages © 2026

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