承接 alagaccia/skebby 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

alagaccia/skebby

Composer 安装命令:

composer require alagaccia/skebby

包简介

Skebby API

README 文档

README

Package for using Skebby SMS gateway with Laravel projects.

Requirements

  • PHP >= 7.0
  • Laravel 8.x, 9.x, 10.x, or 11.x

Installation

Install this package using Composer:

composer require alagaccia/skebby

Publish Configuration (Optional)

The package will automatically register itself with Laravel. Optionally, you can publish the configuration file:

php artisan vendor:publish --tag=skebby-config

This will create config/skebby.php in your Laravel application.

Configuration

Add the following environment variables to your .env file:

SKEBBY_USER="your-skebby-username"
SKEBBY_PWD="your-skebby-password" 
SKEBBY_ALIAS="your-skebby-alias"
SKEBBY_QUALITY="TI"

Usage

Using the Facade

use Skebby;

// Send SMS
$result = Skebby::send('1234567890', 'Hello from Laravel!');

// Get account info
$info = Skebby::getInfo();

// Get remaining credits
$remaining = Skebby::getRemaining();

Using Dependency Injection

use AndreaLagaccia\Skebby\Skebby;

class SmsController extends Controller
{
    public function sendSms(Skebby $skebby)
    {
        $result = $skebby->send('1234567890', 'Hello from Laravel!');
        return response()->json($result);
    }
}

Direct Instantiation

use alagaccia\skebby\Skebby;

$skebby = new Skebby();
$result = $skebby->send('1234567890', 'Hello World!');

Advanced Usage

Error Handling

The package includes comprehensive error handling with custom exceptions:

use alagaccia\skebby\Skebby;
use alagaccia\skebby\Exceptions\SkebbyException;

try {
    $skebby = new Skebby();
    $result = $skebby->send('1234567890', 'Hello World!');
    echo "SMS sent successfully!";
} catch (SkebbyException $e) {
    echo "SMS sending failed: " . $e->getMessage();
    // Handle specific error codes
    if ($e->getCode() == 401) {
        echo "Authentication failed - check your credentials";
    }
}

Message Types

You can specify different message types when sending SMS:

use Skebby;

// Send with specific message type
$result = Skebby::send('1234567890', 'Hello!', Skebby::MESSAGE_CLASSIC_PLUS);

// Send with campaign name for tracking
$result = Skebby::send('1234567890', 'Hello!', null, 'Summer Campaign 2024');

// Send with both message type and campaign name
$result = Skebby::send('1234567890', 'Hello!', Skebby::MESSAGE_CLASSIC_PLUS, 'Summer Campaign 2024');

// Available message types:
// Skebby::MESSAGE_CLASSIC_PLUS  ('GP') - Classic Plus
// Skebby::MESSAGE_CLASSIC       ('TI') - Classic (default)
// Skebby::MESSAGE_BASIC         ('SI') - Basic
// Skebby::MESSAGE_EXPORT        ('EE') - Export
// Skebby::MESSAGE_ADVERTISING   ('AD') - Advertising

Credit Management

Check remaining credits for different message types:

use Skebby;

// Get remaining credits for current message type
$remaining = Skebby::getRemaining();

// Get remaining credits for specific message type
$remaining = Skebby::getRemaining(Skebby::MESSAGE_CLASSIC_PLUS);

// Get all remaining credits
$allCredits = Skebby::getAllRemainingCredits();
// Returns: ['GP' => 100, 'TI' => 200, 'SI' => 300, ...]

Authentication Cache

The package automatically caches authentication credentials for the duration of the request to improve performance:

use Skebby;

// Clear authentication cache if needed
Skebby::clearAuthCache();

Configuration Options

The configuration file supports the following options:

return [
    'SKEBBY_USER' => env('SKEBBY_USER'),
    'SKEBBY_PWD' => env('SKEBBY_PWD'),
    'SKEBBY_ALIAS' => env('SKEBBY_ALIAS'),
    'SKEBBY_QUALITY' => env('SKEBBY_QUALITY', 'TI'), // Default message type
];

API Reference

Skebby Class Methods

  • send(string $phone, string $message, ?string $messageType = null, ?string $campaignName = null): ?array
  • getInfo(): ?array - Get account information
  • getRemaining(?string $messageType = null): int - Get remaining credits
  • getAllRemainingCredits(): array - Get all remaining credits
  • login(): array - Authenticate with API
  • clearAuthCache(): void - Clear authentication cache

alagaccia/skebby 适用场景与选型建议

alagaccia/skebby 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 160 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 01 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 alagaccia/skebby 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 alagaccia/skebby 我们能提供哪些服务?
定制开发 / 二次开发

基于 alagaccia/skebby 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 160
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: NLPL
  • 更新时间: 2022-01-07