Download the PHP package prgayman/laravel-sms without Composer
On this page you can find all versions of the php package prgayman/laravel-sms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-sms
Laravel SMS
Laravel SMS allows you to send SMS from your Laravel application using multiple sms providers, allow to add custom sms provider
Requirements
- php
^7.3|^8.0
- guzzlehttp/guzzle
^7.0.1
Installation
To get the latest version of laravel-sms on your project, require it from "composer":
$ composer require prgayman/laravel-sms
Or you can add it directly in your composer.json file:
Laravel
Register the provider directly in your app configuration file config/app.php config/app.php
:
Laravel >= 5.5 provides package auto-discovery, thanks to rasmuscnielsen and luiztessadri who help to implement this feature in Zatca, the registration of the provider and the facades should not be necessary anymore.
Add the facade aliases in the same file:
Lumen
Register the provider in your bootstrap app file boostrap/app.php
Add the following line in the "Register Service Providers" section at the bottom of the file.
For facades, add the following lines in the section "Create The Application" .
Run Migrations
Publish the migrations with this artisan command:
$ php artisan vendor:publish --tag=laravel-sms-migrations
Configuration
You can publish the config file with this artisan command:
$ php artisan vendor:publish --tag=laravel-sms-config
Available SMS Providers
Provider | URL | Tested | Multiple contacts | Config |
---|---|---|---|---|
JawalSms | https://www.jawalsms.net/ | Yes | Yes | Click |
Taqnyat | https://www.taqnyat.sa/ | Yes | Yes | Click |
Nexmo | https://www.nexmo.com/ | Yes | No | Click |
Twilio | https://www.twilio.com/ | Yes | No | Click |
MoraSa | https://www.mora-sa.com/ | Yes | Yes | Click |
Msegat | https://www.msegat.com/ | Yes | Yes | Click |
Kobikom | https://kobikom.com.tr/ | Yes | Yes | Click |
Unifonic | https://unifonic.com/ | No | Yes | Click |
Jor Mall | https://www.josmsservice.com | Yes | No | Click |
Available SMS Drivers local development
Provider | Multiple contacts | Config |
---|---|---|
array | Yes | - |
log | Yes | Click |
Events
\Prgayman\Sms\Events\MessageSending::class
\Prgayman\Sms\Events\MessageSent::class
\Prgayman\Sms\Events\MessageFailed::class
Types
\Prgayman\Sms\SmsTypes::GENERAL
\Prgayman\Sms\SmsTypes::OTP
\Prgayman\Sms\SmsTypes::WELCOME
\Prgayman\Sms\SmsTypes::AD
Usage
Set default driver
Using .env
Using facades
Enable sms history using database (send multiple contacts is not support store history)
-
Enable the key
SMS_HISTORY_ENABLED
in.env
file -
Make sure publish the migrations with this artisan command:
$ php artisan vendor:publish --tag=laravel-sms-migrations
-
Run migrate with this artisan command:
$ php artisan migrate
Send Message
You can simply send a message like this:
Send using select driver sms
Send multiple contacts
Send using custom type
Send multiple messages (run events and store history per message)
Send using helper function with default driver
Send using helper function and select driver
Send using helper function and custom type
Create custom driver
- Create class extends from
\Prgayman\Sms\Drivers\Driver
and handler send function -
if driver support send multiple contacts please implements from
Prgayman\Sms\Contracts\DriverMultipleContactsInterface
-
Add driver confg in
config/sms.php
- Send message with custom driver
Channel Usage
First you have to create your notification using php artisan make:notification
command.
then Prgayman\Sms\Channels\SmsChannel::class
can be used as channel like the below:
SMS History
Testing
Licence
This library is open-sourced software licensed under the MIT license.