承接 vatly/vatly-laravel 相关项目开发

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

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

vatly/vatly-laravel

最新稳定版本:v0.3.0-alpha.1

Composer 安装命令:

composer require vatly/vatly-laravel

包简介

Laravel integration for Vatly, inspired by Laravel Cashier

README 文档

README

Latest Version on Packagist Tests Total Downloads

Alpha release -- under active development. Expect breaking changes.

Laravel integration for Vatly billing, inspired by Laravel Cashier. Provides Eloquent models, a Billable trait, checkout/subscription builders, webhook handling, and event listeners.

Built on top of vatly/vatly-fluent-php.

Installation

composer require vatly/vatly-laravel:v0.3.0-alpha.1

Pin to an exact version. This is an alpha release and the API will change.

Requirements

  • PHP 8.2+
  • Laravel 10, 11, or 12
  • A Vatly API key (vatly.com)

Setup

  1. Publish the config:
php artisan vendor:publish --tag=vatly-config
  1. Add your API key to .env:
VATLY_API_KEY=test_xxxxxxxxxxxx
VATLY_WEBHOOK_SECRET=your-webhook-secret
  1. Publish and run migrations:
php artisan vendor:publish --tag=vatly-migrations
php artisan vendor:publish --tag=vatly-billable-migrations
php artisan migrate
  1. Add the Billable trait to your User model:
use Vatly\Laravel\Contracts\BillableInterface;
use Vatly\Laravel\Billable;

class User extends Authenticatable implements BillableInterface
{
    use Billable;
}

Usage

// Create a checkout
$checkout = $user->newCheckout()
    ->withItems(collect(['subscription_plan_id']))
    ->create(
        redirectUrlSuccess: 'https://example.com/success',
        redirectUrlCanceled: 'https://example.com/canceled',
    );

// Swap subscription plan
$user->subscription('default')->swap('plan_premium');

// Cancel subscription
$user->subscription('default')->cancel();

Webhooks

The package registers a webhook endpoint at /vatly/webhook automatically. Configure your webhook secret in the Vatly dashboard.

Events dispatched:

  • Vatly\Events\WebhookReceived
  • Vatly\Events\SubscriptionStarted
  • Vatly\Events\SubscriptionCanceledImmediately
  • Vatly\Events\SubscriptionCanceledWithGracePeriod

Testing

composer test

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固