定制 natpnk/transip-laravel 二次开发

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

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

natpnk/transip-laravel

最新稳定版本:1.1.1

Composer 安装命令:

composer require natpnk/transip-laravel

包简介

A Laravel wrapper for the TransIP REST API Client.

README 文档

README

A very easy way to use the TransIP Rest API in your Laravel Project.

Link to documentation

To make full advantage of this package you can see here what functionality can be used within the API of TransIP.

TransIP RestAPI Docs
TransIP PHP Package

Installation

First add your API credentials into your .env file.

TRANSIP_LOGIN=<your_login_name>
TRANSIP_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----<your_private_key_here-----END PRIVATE KEY-----"

# Use the token only with whitelisted IP's (true or false) defaults to true.  
TRANSIP_WHITELIST_ONLY=false

Install with composer

composer require natpnk/transip-laravel

This package will autoload the SrviceProvider and Facade listed below. If it does not automatically you can add it easily with the following steps.

Register the Service Provider:

'providers' => [
    ...
    Natpnk\TransIPLaravel\TransIPServiceProvider::class,
];

Optionally the Facade can be registered:

'aliases' => [
	...
    'Natpnk' => Natpnk\TransIPLaravel\TransIPFacade::class,
    ...
]

You must publish the configuration with this command:

php artisan vendor:publish --provider="Natpnk\TransIPLaravel\TransIPServiceProvider"

This will add a configuration file called 'transip.php' in the config folder with the following contents:

return [

    /*
    |--------------------------------------------------------------------------
    | TransIP Laravel Wrapper
    |--------------------------------------------------------------------------
    |
    */

    'login' => env('TRANSIP_LOGIN'),
    'privateKey' => env('TRANSIP_PRIVATE_KEY'),
    'generateWhitelistOnlyTokens' => env('TRANSIP_WHITELIST_ONLY', true),
];

Usage

Using the Facade

<?php

use TransIP;

// Get all VPS from your account.
$allVps = TransIP::vps()->getAll();

Using the auto IoC binding

<?php

use Transip\Api\Library\TransipAPI;

class TransipTestCommand extends Command {
    
    protected $signature = 'transip:test';
    
    public function __construct(){
        parent::__construct();
    }
    
    public function handle(TransipAPI $api)){
        $allVps = $api->vps()->getAll();
    }
}

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固