Download the PHP package ariaieboy/kavenegar-laravel without Composer
On this page you can find all versions of the php package ariaieboy/kavenegar-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package kavenegar-laravel
Kavenegar Laravel
First of all you will ned an API Key . You can get one Here.
Supported Laravel Versions:
- V.4
- V.5
- V.6
- V.7
- V.8
- V.9
- V.10
We highly recomment you to always use the latest version of laravel
Installation
Step 1 - Install the package
-
Method 1: You can install kavenegar/laravel with Composer directly in your project:
- Method 2: Add this line to Composer.json file in your project
Then run following command to download extension using composer
Step 2
Head to config/app.php and add this line to the end of providers Array:
So that array must me something like this:
Then in the config/app.php and add this line to the end of aliases Array:
Step 3 - Publish
Run this command in your project dirctory:
In the message appear, find the number of Kavenegar, enter the related number then hit Enter. for Example in the below case you must enter 9 then enter:
Step 4 - Api-Key
Now you must define your API Key to project. for this head to config/kavenegar.php then put your API KEY in the code:
All Set
Usage
You can use the package where ever you want.
- First use the class:
Then use this pattern to send SMS:
Use this pattern to send VerifyLookup SMS:
You can find all the Error handlings and API parameters and Usage methods in the KaveNegar website.
Usage in Notifications
Also you can use KavengarChannel for your notification:
create your notification:
extend your notification from KavenegarBaseNotification:
overide the toKavengar function:
you should add Notifiable trait and routeNotificationForKavenegar method in your model
Notice: IF you DO NOT add routeNotificationForKavenegar in your notifiable model then you should set your receiver in your notification :
for send verify lookup message you should use verifyLookup method for set method name and tokens:
Contribution
Bug fixes, docs, and enhancements welcome! Please let us know [email protected]