farazsms / symfony-bundle
Symfony bundle for FarazSMS · IranPayamak (فراز اس ام اس · ایران پیامک) — https://farazsms.com. Autowire the FarazSMS client, configured from env.
Package info
github.com/ghaffari273/farazsms-symfony
Type:symfony-bundle
pkg:composer/farazsms/symfony-bundle
Requires
- php: >=8.1
- farazsms/php: ^1.0
- symfony/config: ^6.0|^7.0
- symfony/dependency-injection: ^6.0|^7.0
- symfony/framework-bundle: ^6.0|^7.0
- symfony/http-kernel: ^6.0|^7.0
This package is not auto-updated.
Last update: 2026-06-19 18:02:58 UTC
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.