An SMS notification channel for the PHP framework Laravel.

Overview

Laravel SMS notification channel

An SMS notification channel for the PHP framework Laravel.

Supported SMS gateways:

Installation

Add the package as a requirement to your composer.json:

$ composer require andreasnij/laravel-sms-notification-channel

If you want to use the 46elks, Cellsynt or Telenor SMS Pro gateway you also you need implementations of PSR-7: HTTP message interfaces, PSR-17: HTTP Factories and PSR-18: HTTP Client. A popular package for this is Guzzle. You can install it with:

$ composer require guzzlehttp/guzzle:^7.0 guzzlehttp/psr7:^2.0

You may choose to use any other implementations of the PSR interfaces though.

If you want to use the Twilio gateway you also need to install the Twilio SDK:

$ composer require twilio/sdk

If you want to use the Vonage gateway you also need to install the Vonage client:

$ composer require vonage/client-core

Next you need to publish the configuration file to your config directory:

$ php artisan vendor:publish --provider="LaravelSmsNotificationChannel\ServiceProvider" --tag="config"

Edit your sms.php configuration file to fit your application.

Usage example

class TestUser 
{
    use Notifiable;

    public string $phone_number = '46700000000';

    public function routeNotificationForSms(Notification $notification): ?string
    {
        return $this->phone_number;
    }
}

class TestNotification extends Notification
{
    public function via(mixed $notifiable): array
    {
        return ['sms'];
    }

    public function toSms(mixed $notifiable): string
    {
        return 'Test message';
    }
}

$user = new User();
$user->notify(new TestNotification());

You can also use this package to send sms manually (without notifications):

use AnSms\SmsTransceiverInterface;
use AnSms\Message\Message;

$smsTransceiver = app(SmsTransceiverInterface::class);

$message = Message::create('46700000000', 'Hello world!');
$smsTransceiver->sendMessage($message);

Requirements

  • Requires PHP 8.0 or above.

Author

Andreas Nilsson (https://github.com/andreasnij)

License

This software is licensed under the MIT License - see the LICENSE file for details.

You might also like...
SMS service provider for Laravel

laravel-sms SMS service provider for Laravel and Lumen. Uses SMS Client to enable sending SMS messages using the following drivers: nexmo clockwork te

laravel send sms. kavenegar, ghasedak

Requirements laravel = 7 Installation composer require ehsanmoradi/laravel-sms Publish the configuration file (this will create a laravel-sms.php

A Toast notification library for the Laravel TALL stack.
A Toast notification library for the Laravel TALL stack.

A Toast notification library for the Laravel TALL stack. You can push notifications from the backend or frontend to render customizable toasts with almost zero footprint on the published CSS/JS 🔥🚀

Slack notification for Laravel as it should be. Easy, fast, simple and highly testable.
Slack notification for Laravel as it should be. Easy, fast, simple and highly testable.

Based on illuminate/mail About Laravel Slack Slack notification for Laravel as it should be. Easy, fast, simple and highly testable. Since it uses On-

AmaranJS stylish notification for your laravel application.

AmaranJS Laravel 5 Package AmaranJS L5 package is a Laravel wrapper for my jquery plugin AmaranJS.You can create easy and stylish notifications with A

Our Laravel Sendgrid Notification package

laravel-sendgrid-notification-channel Laravel Sendgrid Notification channel Installation To get started, you need to require this package: composer re

 Lara-Izitoast : Laravel Notification Package
Lara-Izitoast : Laravel Notification Package

Lara-Izitoast : Laravel Notification Package This is a laravel notification wrapper build with http://izitoast.marcelodolce.com javascript library. Ho

Notification package for Laravel

Package is looking for maintainers Please contact me if interested. Notification package for Laravel4 / Laravel5 A simple notification management pack

Laravel notification manager

Easily manage notifications and notification subscriptions in your Laravel application.

Releases(0.2)
Owner
Andreas
Software Developer (using mostly PHP & JavaScript)
Andreas
@Authy notification channel for @Laravel, with the ability to send in-app, sms, and call verification tokens.

Authy Notification Channel for Laravel Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens. Tab

Laravel Notification Channels 57 Dec 19, 2022
Laravel SMS Notification Channel

Laravel SMS Notification Channel Installation composer require guangda/laravel-sms-notification-channel env 配置 SMS_PROVIDER=yunpian SMS_SIGNATURE=【签名

Guangda 6 Dec 29, 2021
Google Chat - Laravel Notification Channel

Google Chat - Laravel Notification Channel This package makes it easy to send notifications using Google Chat , (formerly known as Hangouts Chat) with

Laravel Notification Channels 36 Dec 6, 2022
Lark Notification Channel for laravel.

Lark notifications channel for Laravel This package makes it easy to send Lark using the Laravel notification system. Supports 5.5+, 6.x, 7.x and 8.x.

null 1 Nov 3, 2021
Laravel FCM (Firebase Cloud Messaging) Notification Channel

Laravel FCM Notification Laravel FCM (Firebase Cloud Messaging) Notification Channel Use this package to send push notifications via Laravel to Fireba

Vishal Dudhatra 3 Jul 3, 2022
Implementations for different SMS providers for EspoCRM. Can be used for 2-factor authentication or automatic SMS sending via Workflow and BPM tools.

SMS Providers for EspoCRM An installable extension. Supported SMS Providers Twilio Spryng sms77 Setting up Install the extension. At Administration >

EspoCRM - Open Source CRM 11 Nov 30, 2022
📨 Facebook Notifications Channel for Laravel

Facebook Notifications Channel for Laravel This package makes it easy to send notifications using the Facebook Messenger with Laravel. Contents Instal

Laravel Notification Channels 142 Dec 27, 2022
✈️ Whatsapp Notifications Channel for Laravel

Whatsapp Notifications Channel for Laravel This package makes it easy to send Whatsapp notification using Venom API with Laravel. This package was cre

Felipe Damaceno Teodoro 63 Dec 7, 2022
Notion.so notifications channel for Laravel

Installation composer require astroshippers/notion-notification-channel Usage Inside eloquent model: public function routeNotificationForNotion(): arr

AstroShippers 3 Jul 4, 2022
Multiple channels of laravel exception notification(DingTalk、FeiShu、ServerChan、WeWork、XiZhi). - 多种通道的 laravel 异常通知(钉钉群机器人、飞书群机器人、Server 酱、企业微信群机器人、息知)。

laravel-exception-notify 简体中文 | ENGLISH Multiple channels of laravel exception notification(DingTalk、FeiShu、ServerChan、WeWork、XiZhi). - 多种通道的 laravel

guanguans 61 Dec 8, 2022