farazsms/symfony-bundle
Composer 安装命令:
composer require farazsms/symfony-bundle
包简介
Symfony bundle for FarazSMS · IranPayamak (فراز اس ام اس · ایران پیامک) — https://farazsms.com. Autowire the FarazSMS client, configured from env.
README 文档
README
FarazSMS · IranPayamak (فراز اس ام اس · ایران پیامک)
Symfony bundle that autowires the farazsms/php client into your
application, configured from environment variables. Supports Symfony 6 & 7 and PHP >= 8.1.
Installation
composer require farazsms/symfony-bundle
With Symfony Flex the bundle is registered automatically. Otherwise add it to
config/bundles.php:
return [ // ... FarazSMS\SymfonyBundle\FarazSMSBundle::class => ['all' => true], ];
Configuration
Create config/packages/farazsms.yaml:
farazsms: api_key: '%env(FARAZSMS_API_KEY)%' # base_url defaults to https://api.iranpayamak.com # base_url: '%env(FARAZSMS_BASE_URL)%'
Set the API key in your .env:
FARAZSMS_API_KEY=your-api-key-here
Usage
The FarazSMS\FarazSMS client is registered as a service and can be autowired
directly into your own services and controllers:
use FarazSMS\FarazSMS; final class NotificationService { public function __construct(private FarazSMS $sms) {} public function notify(): void { $this->sms->sendPattern('your-pattern-code', '0912xxxxxxx', [ 'name' => 'Ali', ]); // or a simple message: // $this->sms->sendSimple('Hello', ['0912xxxxxxx'], '90008361'); // check balance: // $balance = $this->sms->balance(); } }
License
Released under the MIT License. Copyright (c) 2026 FarazSMS.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-18