定制 vented/enhance-api-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

vented/enhance-api-laravel

Composer 安装命令:

composer require vented/enhance-api-laravel

包简介

An Enhance API SDK tailored for usage within Laravel

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

An Enhance API SDK tailored for usage within Laravel applications. This package provides a clean, Laravel-friendly wrapper around the auto-generated Enhance API client, making it easy to integrate Enhance's hosting management capabilities into your Laravel projects.

Installation

You can install the package via composer:

composer require vented/enhance-api-laravel

You can publish the config file with:

php artisan vendor:publish --tag="enhance-config"

Configuration

Set your Enhance API credentials in your .env file:

ENHANCE_API_URL=https://your-enhance-api-endpoint.com
ENHANCE_API_TOKEN=your-api-token-here
ENHANCE_API_ORGANIZATION=your-default-org-id

This is the contents of the published config file:

return [
    'base_url' => env('ENHANCE_API_URL', ''),
    'api_key' => env('ENHANCE_API_TOKEN'),
    'default_organization' => env('ENHANCE_API_ORGANIZATION', ''),
    'timeout' => env('ENHANCE_API_TIMEOUT', 30),
    'retry' => [
        'times' => env('ENHANCE_API_RETRY_TIMES', 3),
        'sleep' => env('ENHANCE_API_RETRY_SLEEP', 1000),
    ],
];

Usage

Via Facade

use Vented\EnhanceApiLaravel\Facades\Enhance;

// Get all organizations
$orgs = Enhance::orgs()->getAllOrgs();

// Get websites
$websites = Enhance::websites()->getWebsites();

// Get domains
$domains = Enhance::domains()->getDomains();

// Manage servers
$servers = Enhance::servers()->getServers();

Via Service Container

use Vented\EnhanceApiLaravel\EnhanceApiLaravel;

class YourController extends Controller
{
    public function __construct(
        private EnhanceApiLaravel $enhance
    ) {}

    public function index()
    {
        $websites = $this->enhance->websites()->getWebsites();
        $domains = $this->enhance->domains()->getDomains();
        
        return view('dashboard', compact('websites', 'domains'));
    }
}

Available API Endpoints

The SDK provides access to all Enhance API endpoints:

  • Apps: Enhance::apps() - Application management
  • Backups: Enhance::backups() - Backup operations
  • Customers: Enhance::customers() - Customer management
  • DNS: Enhance::dns() - DNS record management
  • Domains: Enhance::domains() - Domain operations
  • Emails: Enhance::emails() - Email account management
  • MySQL: Enhance::mysql() - Database management
  • Organizations: Enhance::orgs() - Organization management
  • Servers: Enhance::servers() - Server management
  • Websites: Enhance::websites() - Website management
  • WordPress: Enhance::wordpress() - WordPress-specific operations
  • And many more...

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固