farazsms/symfony-bundle

Symfony bundle for FarazSMS · IranPayamak (فراز اس ام اس · ایران پیامک) — https://farazsms.com. Autowire the FarazSMS client, configured from env.

Maintainers

Package info

github.com/ghaffari273/farazsms-symfony

Homepage

Type:symfony-bundle

pkg:composer/farazsms/symfony-bundle

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-06-18 19:32 UTC

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.