mrhmh / sms-rahyab
Installs: 57
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/mrhmh/sms-rahyab
This package is auto-updated.
Last update: 2025-10-17 16:38:04 UTC
README
This package makes it easy to send notifications using sms.rahyab.ir.
Installation
Install this package with Composer:
composer require mrhmh/sms-rahyab
Setting up the Rahyab service
Add your Rahyab credential to config/services.php:
// config/services.php ... 'sms_rahyab' => [ 'company' => env('SMS_RAHYAB_COMPANY'), 'host' => env('SMS_RAHYAB_HOST'), 'port' => env('SMS_RAHYAB_PORT'), 'username' => env('SMS_RAHYAB_USERNAME'), 'password' => env('SMS_RAHYAB_PASSWORD'), 'sender' => env('SMS_RAHYAB_SENDER'), 'token' => env('SMS_RAHYAB_TOKEN'), ], ...
Usage
You can use the channel in your via() method inside the notification:
use Illuminate\Notifications\Notification; use MrHMH\SmsRahyab\SmsRahyabChannel; use MrHMH\SmsRahyab\SmsRahyabMessage; class AccountApproved extends Notification { public function via($notifiable) { return [SmsRahyabChannel::class]; } public function toSmsRahyab($notifiable) { return SmsRahyabMessage::create("Task #{$notifiable->id} is complete!"); } }
In your notifiable model, make sure to include a routeNotificationForSmsrahyab() method, which return a phone number.
public function routeNotificationForSmsrahyab() { return $this->mobile; }
License
The MIT License (MIT). Please see License File for more information.