dsilva01 / ombala-sms
Ombala Notifications channel for Laravel 9.x and 10.x.
Requires
- php: ^8.1
- ext-json: *
- guzzlehttp/guzzle: ^7.0
- illuminate/notifications: ^9.0|^10.0|^11.0
- illuminate/support: ^9.0|^10.0|^11.0
Requires (Dev)
- larastan/larastan: ^1.0|^2.0
- laravel/pint: ^1.5
- mockery/mockery: ^1.3
- orchestra/testbench: ^7.31|^8.11|^9.0
- pestphp/pest: ^1.21|^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2025-08-04 10:49:46 UTC
README
This package makes it easy to send notifications using Ombala with Laravel and 9.x and 10.x.
Contents
Installation
You can install this package via composer:
composer require dsilva01/ombala-sms
Setting up the Ombala service
Add your Ombala token, default from name (or phone number) to your config/services.php:
// config/services.php ... 'ombala' => [ 'endpoint' => env('OMBALA_ENDPOINT', 'https://api.useombala.ao/v1/messages'), 'token' => env('OMBALA_TOKEN', 'YOUR OMBALA TOKEN HERE'), 'from' => env('OMBALA_SENDER', 'YOUR OMBALA SENDER HERE') ], ...
Usage
You can use the channel in your via() method inside the notification:
use Illuminate\Notifications\Notification; use NotificationChannels\Ombala\OmbalaMessage; class AccountApproved extends Notification { public function via($notifiable) { return ["ombala"]; } public function toOmbala($notifiable) { return (new OmbalaMessage)->content("Your account was approved!"); } }
In your notifiable model, make sure to include a routeNotificationForOmbala() method, which returns a phone number or an array of phone numbers.
public function routeNotificationForOmbala() { return $this->phone; }
On-Demand Notifications
Sometimes you may need to send a notification to someone who is not stored as a "user" of your application. Using the Notification::route method, you may specify ad-hoc notification routing information before sending the notification:
Notification::route('ombala', '9123123321') ->notify(new InvoicePaid($invoice));
Available Message methods
from()
: Sets the from's name. Make sure to register the from name at you Ombala dashboard.
content()
: Set a content of the notification message. This parameter should be no longer than 918 char(6 message parts),
test()
: Send a test message to specific mobile number or not. This parameter should be boolean and default value is true
.
Testing
$ composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.