stellarsecurity/subscription-laravel 问题修复 & 功能扩展

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

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

stellarsecurity/subscription-laravel

最新稳定版本:1.0.3

Composer 安装命令:

composer require stellarsecurity/subscription-laravel

包简介

Stellar Security Subscription client for PHP/Laravel – simple wrapper around the Stellar Subscription API.

README 文档

README

Lightweight Laravel wrapper for the internal Stellar Subscription API.
It gives you a simple SubscriptionService + StellarSubscription facade that other Stellar apps can reuse via composer require.

All comments in code are in English.

Installation

composer require stellarsecurity/subscription-laravel

Laravel package auto-discovery will register the service provider and facade for you:

  • Provider: StellarSecurity\SubscriptionLaravel\Providers\SubscriptionServiceProvider
  • Facade: StellarSubscription

If you want to disable auto-discovery, you can still register them manually in config/app.php.

Configuration

Publish the config (optional):

php artisan vendor:publish --tag=stellar-subscription-config

Environment variables used:

# External API base URL (normally you keep the default)
STELLAR_SUBSCRIPTION_BASE_URL=https://stellersubscriptionapiprod.azurewebsites.net/api/

# Names of env vars that hold Basic Auth credentials
STELLAR_SUBSCRIPTION_USERNAME_ENV=APPSETTING_API_USERNAME_STELLER_SUBSCRIPTION_API
STELLAR_SUBSCRIPTION_PASSWORD_ENV=APPSETTING_API_PASSWORD_STELLER_SUBSCRIPTION_API

# And then you actually define these:
APPSETTING_API_USERNAME_STELLER_SUBSCRIPTION_API=your-username
APPSETTING_API_PASSWORD_STELLER_SUBSCRIPTION_API=your-password

Usage

Via Facade

use StellarSubscription;
use StellarSecurity\SubscriptionLaravel\Enums\SubscriptionType;

// Find all subscriptions for a user
$response = StellarSubscription::findUserSubscriptions(123, SubscriptionType::VPN->value);

if ($response->successful()) {
    $data = $response->json();
}

Via Dependency Injection

use StellarSecurity\SubscriptionLaravel\SubscriptionService;

class SomeController
{
    public function index(SubscriptionService $subs)
    {
        $response = $subs->user(123);

        if ($response->successful()) {
            // ...
        }
    }
}

Enums

The package ships with two simple enums you can reuse across projects:

use StellarSecurity\SubscriptionLaravel\Enums\SubscriptionStatus;
use StellarSecurity\SubscriptionLaravel\Enums\SubscriptionType;

SubscriptionStatus::ACTIVE;
SubscriptionType::ANTIVIRUS;

About Stellar Security

Stellar Security is building a Swiss-based privacy & security ecosystem:
hardened phones, VPN, antivirus, secure cloud, and more — all designed with a security-first mindset.

This package is a small building block so any Stellar Laravel app can talk to the shared Subscription API using one consistent client.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固