Download the PHP package al-saloul/taqnyat without Composer
On this page you can find all versions of the php package al-saloul/taqnyat. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package taqnyat
Laravel Taqnyat SMS Package
Overview
The Laravel Taqnyat SMS package provides a simple integration with the Taqnyat SMS API to send SMS messages directly from your Laravel application. It includes methods for sending SMS messages, querying your account balance, retrieving available senders, and checking the system status of Taqnyat.
Features
- Send SMS: Send SMS messages to multiple recipients.
- Account Balance: Retrieve your Taqnyat account balance.
- Available Senders: Fetch the list of available sender names.
- System Status: Check the current status of the Taqnyat system.
- Configurable: Easily configure API authentication and default sender details.
Requirements
- PHP >= 7.4
- Laravel 7.x, 8.x, 9.x, 10.x or 11.x
- GuzzleHttp for making HTTP requests.
Installation
Install the package via Composer:
After installing the package, publish the configuration file:
This command will create the config/taqnyat-sms.php
configuration file where you can set your API authentication and sender information.
Configuration
After publishing the config file, update your .env
file with your Taqnyat API credentials:
Config Options
TAQNYAT_SMS_AUTH
: Your API key for authentication.TAQNYAT_SMS_SENDER
: The default sender name for SMS messages.TAQNYAT_SMS_BASE_URL
: The base URL for the Taqnyat API (default ishttps://api.taqnyat.sa
).
Usage
You can use the package by either calling the TaqnyatSms
facade or injecting the TaqnyatSms
service into your classes.
Example: Sending an SMS via Facade
Example: Injecting TaqnyatSms
in Controller
Available Methods
1. Send SMS
$body
: The SMS message content.$recipients
: Array of recipient phone numbers.$sender
: Sender name (optional, defaults to configured sender).$smsId
(optional): Custom SMS ID for tracking purposes.$scheduled
(optional): Scheduled date and time for sending the message.$deleteId
(optional): ID for message deletion after sending.
2. Get Account Balance
Retrieve your account balance from Taqnyat:
3. Get Available Senders
Get the list of available SMS sender names:
4. Check System Status
Check the status of the Taqnyat system:
Handling Errors
All methods use Guzzle for HTTP requests and are wrapped in try-catch
blocks to handle exceptions gracefully. In case of an error, you will receive a descriptive error message which can help in debugging.
Example: Handling Errors
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contributions are welcome! If you would like to contribute, please submit a pull request or open an issue for any bugs or feature requests.
Steps to Contribute
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
. - Make your changes.
- Submit a pull request.
License
This package is open-sourced software licensed under the MIT License.
All versions of taqnyat with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0