alishojaeiir / smschi
simple laravel package to sending sms , supports multiple drivers
Requires
- php: >=7.2
- guzzlehttp/guzzle: >=6.2
- illuminate/broadcasting: ^5.8|^6.0|^7.0|^8.0
- illuminate/support: ^5.8|^6.0|^7.0|^8.0
This package is auto-updated.
Last update: 2025-03-17 17:00:45 UTC
README
Laravel Sending SMS
This is a Laravel Package for Sending sms. This package supports Laravel 5.8+
.
This packages works with multiple drivers, and you can create custom drivers if you can't find them in the current drivers list (below list).
List of contents
List of available drivers
Install
Via Composer
$ composer require alishojaeiir/smschi
Configure
If you are using Laravel 5.5
or higher then you don't need to add the provider and alias. (Skip to b)
a. In your config/app.php
file add these two lines.
// In your providers array. 'providers' => [ ... /* * Package Service Providers... */ Alishojaeiir\Smschi\SmschiServiceProvider::class, /* * Application Service Providers... */ ... ], // In your aliases array. 'aliases' => [ ... 'smschi' => Alishojaeiir\Smschi\SmschiFacade::class, ],
b. then run php artisan vendor:publish
to publish config/smschi.php
file in your config directory.
In the config file you can set the default driver
to use for all sending. But you can also change the driver at runtime.
Choose what provider you would like to use in your application. Then make that as default driver so that you don't have to specify that everywhere. But, you can also use multiple providers in a project.
// Eg. if you want to use parsasms. 'default' => 'parsasms',
Then fill the credentials for that gateway in the drivers array.
'drivers' => [ 'parsasms' => [ 'apiUrl' => "http://api.smsapp.ir/v2/sms/", 'apiKey' => "api_key", 'sender' => "sender number", ], ... ]
How to use
In your code, use it like the below:
\smschi::prepare($receiver, $message)->send();
Security
If you discover any security related issues, please email alishojaei34@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.