iranian-laravel-sms maintained by novinvision
Description
A laravel package for send sms notification with iranian sms providers like ippanel, sms.ir, kavenegar, mellipaymak, ...
Author
Last update
2025/09/23 10:41
(v1.0.2)
License
Downloads
2
Tags
sms - laravel - laravel-sms - kavenegar - smsir - ippanel - novinvision - laravel-sms-notification - melli-payamak
# 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