Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ohmydevops/smsir-php
📩 Unofficial sms.ir PHP/Laravel Package.
https://github.com/ohmydevops/smsir-php
composer laravel php smsir
Last synced: 3 months ago
JSON representation
📩 Unofficial sms.ir PHP/Laravel Package.
- Host: GitHub
- URL: https://github.com/ohmydevops/smsir-php
- Owner: ohmydevops
- License: mit
- Created: 2020-10-21T10:26:05.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-06T10:26:09.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T23:42:50.471Z (3 months ago)
- Topics: composer, laravel, php, smsir
- Language: PHP
- Homepage: https://sms.ir
- Size: 47.9 KB
- Stars: 18
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![StyleCI](https://github.styleci.io/repos/305987675/shield?branch=main)](https://github.styleci.io/repos/305987675?branch=main) [![Latest Stable Version](https://poser.pugx.org/amirbagh75/smsir-php/v)](//packagist.org/packages/amirbagh75/smsir-php) [![Total Downloads](https://poser.pugx.org/amirbagh75/smsir-php/downloads)](//packagist.org/packages/amirbagh75/smsir-php) [![License](https://poser.pugx.org/amirbagh75/smsir-php/license)](//packagist.org/packages/amirbagh75/smsir-php)
## Unofficial PHP Package for sms.irInspired by the [official package](https://github.com/IPeCompany/SmsirLaravel). The official package just working in laravel! This package working in every PHP project
PHP Versions Supported: `7.3, 7.4, 8.0, 8.1`
Laravel Versions Supported: `8, 9, 10`### How to install:
```
composer require amirbagh75/smsir-php
```### Example (Pure PHP)
```php
getSentMessages(1, 250);
print_r($res->messages);
print_r($res->countOfAll);
} catch (Throwable $e) {
error_log($e->getMessage(), 0);
}
```### Example (Laravel)
First add these environment variables in your .env file:
```
SMSIR_API_KEY="xxxx"
SMSIR_SECRET_KEY="xxxx"
SMSIR_LINE_NUMBER="xxxx"
SMSIR_HTTP_TIMEOUT="10"
```
Then use it like the following example:```php
getMessage());
}
// do something ...
}
}
```### Current methods:
Response models structures are in the `src/Responses` directory
```php
smsCredit(): CreditResponsegetSMSLines(): SMSLinesResponse
send(array $messages, array $mobileNumbers, $sendDateTime = null): SendResponse
sendVerificationCode(string $code, string $mobileNumber): VerificationCodeResponse
ultraFastSend(array $parameters, string $templateId, string $mobileNumber): VerificationCodeResponse
getSentMessages($fromDate, $toDate, $pageNumber = 1, $perPage = 100): SentMessagesResponse
getReceivedMessages($fromDate, $toDate, $pageNumber = 1, $perPage = 100): ReceivedMessagesResponse
```## Versioning
We use [Semantic Versioning](http://semver.org/). [See the available versions](https://github.com/amirbagh75/smsir-php/releases).
## Authors
- **[Amirhossein Baghaie](https://github.com/amirbagh75)** - _Maintainer_
- **[Ariaieboy](https://github.com/ariaieboy)** - _Collaborator_