PHPackages                             va/smart-sms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. va/smart-sms

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

va/smart-sms
============

A package to send sms notification in laravel apps.

v1.0.2(5y ago)71201MITPHPPHP ^7.1.3

Since Nov 13Pushed 5y ago1 watchersCompare

[ Source](https://github.com/imvahid/smart-sms)[ Packagist](https://packagist.org/packages/va/smart-sms)[ Docs](https://github.com/va1hi9da9sh2ou0rz2ad1eh7/smart-sms)[ RSS](/packages/va-smart-sms/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Laravel Sms Notification
========================

[](#laravel-sms-notification)

[![GitHub issues](https://camo.githubusercontent.com/c9f115b0dc95069a530884f91159c1fa1f3dc54a9c1e43714a88302e6e813638/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f7661316869396461397368326f7530727a326164316568372f736d6172742d736d733f7374796c653d666c61742d737175617265)](https://github.com/va1hi9da9sh2ou0rz2ad1eh7/cutlet-helper/issues)[![GitHub stars](https://camo.githubusercontent.com/de8601b514bd64ac43804e7b72ee68144bee13448d75146d042449de7c51664d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f7661316869396461397368326f7530727a326164316568372f736d6172742d736d733f7374796c653d666c61742d737175617265)](https://github.com/va1hi9da9sh2ou0rz2ad1eh7/cutlet-helper/stargazers)[![GitHub forks](https://camo.githubusercontent.com/11df229d95b1d58ce88550002d1e3c8c184195ba2ab806cf441aab09cd70c3f4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f7661316869396461397368326f7530727a326164316568372f736d6172742d736d733f7374796c653d666c61742d737175617265)](https://github.com/va1hi9da9sh2ou0rz2ad1eh7/cutlet-helper/network)[![GitHub license](https://camo.githubusercontent.com/ab89dcbceb77c46d9115bf390015464ca0b6f6016fc033c26c4de05b99474423/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7661316869396461397368326f7530727a326164316568372f736d6172742d736d733f7374796c653d666c61742d737175617265)](https://github.com/va1hi9da9sh2ou0rz2ad1eh7/cutlet-helper/blob/master/LICENSE)

Sms Notification service and channel for send sms with [smartsms.ir](https://smartsms.ir/)

How to install and config [va/smart-sms](https://github.com/va1hi9da9sh2ou0rz2ad1eh7/smart-sms) package?
--------------------------------------------------------------------------------------------------------

[](#how-to-install-and-config-vasmart-sms-package)

#### Installation

[](#installation)

```

composer require va/smart-sms

```

#### Publish Config file

[](#publish-config-file)

```

php artisan vendor:publish --tag=smart-sms

```

#### Where is the config file? In config/smart-sms.php

[](#where-is-the-config-file-in-configsmart-smsphp)

```

'line_number' => env('SMS_LINE_NUMBER'),
'user_id' => env('SMS_USER_ID'),
'password' => env('SMS_PASSWORD'),
'default_sms_rcpt' => env('SMS_DEFAULT_SMS_RCPT'),
'mobile_field_name' => env('SMS_MOBILE_FIELD_NAME', 'mobile')

```

#### Set You're private configs in .env file, for example

[](#set-youre-private-configs-in-env-file-for-example)

```

SMS_LINE_NUMBER=10001010
SMS_USER_ID=12345
SMS_PASSWORD=123456789
SMS_DEFAULT_SMS_RCPT=0901***1020 // You're phone number for test on local mode or (.env => APP_ENV=local)
SMS_MOBILE_FIELD_NAME=mobile // Name of the mobile field in you're User model or users migration or users table

```

How to use [va/smart-sms](https://github.com/va1hi9da9sh2ou0rz2ad1eh7/smart-sms) package?
-----------------------------------------------------------------------------------------

[](#how-to-use-vasmart-sms-package)

#### Default Facade for send message and it's methods

[](#default-facade-for-send-message-and-its-methods)

```

// The default message:

$message = 'You're message;

// If we want to send a message to $user:

$user->notify(SmsNotificationFacade::message($message)); // mobile = $user->mobile, message = $message
or
$request->user->notify(SmsNotificationFacade::message($message)); // mobile = $user->mobile, message = $message

// If we want to send a mesage to another mobile number:

$user->notify(SmsNotificationFacade::message($message)->mobile('0901***1020')); // mobile = 0901***1020, message = $message

// If we want to send a message to another mobile numbers (Send Group message):

$user->notify(SmsNotificationFacade::message($message)->group(['0901***1020', '0901***3040']));

```

#### Create a custom sms notification and use this

[](#create-a-custom-sms-notification-and-use-this)

- Make a new notification

    ```
    php artisan make:sms-notification SendActivationNotification

    ```
- In which directory was this class made?

    ```
    app/Notifications/Message/SendActivationNotification.php

    ```
- Content of this Notification

    ```
