novinvision / iranian-laravel-sms
A laravel package for send sms notification with iranian sms providers like ippanel, sms.ir, kavenegar, mellipaymak, ...
v1.0.2
2025-09-23 08:41 UTC
Requires
- php: ^7|^8
- laravel/framework: ^10.0|^11.0
- tzsk/sms: ^9.0
README
# Laravel SMS Notification Channel This package provides a **custom SMS notification channel** for Laravel, built on top of [tzsk/sms](https://github.com/tzsk/sms). --- ## Installation ```bash composer require novinvision/iranian-laravel-sms ``` Publish the config file ```bash $ php artisan sms:publish ``` --- ## Usage ### Create a Notification ```php <?php namespace App\Notifications; use NovinVision\IranianLaravelSMS\Messages\SmsMessage; use Illuminate\Notifications\Notification; class SmsTest extends Notification { public function via($notifiable) { return ['sms']; } public function toSms(object $notifiable): SmsMessage { return (new SmsMessage) ->line(sprintf("Dear %s", $notifiable->name)) ->line("It is Test Sms Message"); } } ``` ### Add Route to User Model ```php public function routeNotificationForSms(): ?string { return $this->mobile; } ``` ### Send the Notification ```php $user->notify(new \App\Notifications\SmsTest()); ``` --- ## License MIT