farazsms/symfony-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固