juststeveking/laravel-envoyer-sdk
Composer 安装命令:
composer require juststeveking/laravel-envoyer-sdk
包简介
A simple to use PHP class to work with the Laravel Envoyer API
README 文档
README
A simple to use PHP class to work with the Laravel Envoyer API
Requirements
- PHP ^7.4
- PHP ext-json
Installation
The preferred method of installation is to use composer:
$ composer require juststeveking/laravel-envoyer-sdk
To work with this package, firstly you must have a Laravel Envoyer account, and secondly you must create an API token through Laravel Envoyer itself.
Usage
You create a simple SDK like so:
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default );
Once you have $envoyer set up, you can now start to work with the resources through the API:
Managing Projects
The simple way to manage envoyer projects through the SDK:
List all Projects
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->projects->all();
Create a new Project
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->projects->save([ 'name' => 'SDK test', 'provider' => 'github', // bitbucket, github, gitlab, gitlab-self 'type' => 'laravel-5', // laravel-5. laravel-4, other 'repository' => 'laravel/laravel', 'branch' => 'master' ]);
Fetch a Specific Project
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->projects->find('id-of-project');
Modify a Project
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->projects->modify('id-of-project', [ 'name' => 'Project name update through SDK', ]);
Deleting a Project
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->projects->delete('id-of-project');
Update a Project's Source
Note that all the options are required, you cannot just parse through push_to_deploy as a single option
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->projects->updateSource('id-of-project', [ 'provider' => 'github', 'repository' => 'laravel/laravel', 'branch' => '8.x', 'push_to_deploy' => true, ]);
Managing Servers
The simple way to manage envoyer servers through the SDK:
List all Servers for a Project
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->servers->on('id-of-project')->all();
Create a new Server for a Project
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->servers->on('id-of-project')->create([ 'name' => 'Server Name', 'connectAs' => 'forge', 'host' => 'ip-address-here', 'phpVersion' => 'php80' // php80, php74, php73, php72, php71, php70, php56 ]);
Fetch a single Server for a Project
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->servers->on('id-of-project')->first('id-of-your-server');
Modify a Server
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->servers->on('id-of-project')->modify('id-of-your-server', [ 'name' => 'SDK Server' ]);
Delete a Server
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->servers->on('id-of-project')->remove('id-of-your-server');
Managing Environments on a Project
The simple way to manage project environments through the SDK:
Get current environment
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->environments->on('id-of-project')->key('1234')->all();
Get environment servers
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->environments->on('id-of-project')->key('1234')->servers();
Updating project environments
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->environments->on('id-of-project') ->key('1234')->onServer(1, 2, 3) ->put('test=api', 'another=value')
Resetting environment key
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->environments->on('id-of-project')->key('new-env-key')->reset('new-key');
Listing available actions from Envoyer
Get all Actions
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->actions->all();
Managing Action Hooks for a Project
The simple way to manage action hooks for a project through the SDK:
List all Hooks
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->hooks->on('id-of-project')->all();
Create a new Hook
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->hooks->on('id-of-project')->create([ 'name' => 'list', 'script' => 'll', 'runAs' => 'forge', 'actionId' => 'id-of-action', 'timing' => 'after', 'servers' => ['id-of-server', 'another-id-of-a-server'] ]);
Get a single Hook
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->hooks->on('id-of-project')->first('id-of-hook');
Updating a Hook
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->hooks->on('id-of-project')->modify('id-of-hook', [ 'name' => 'list files and directories' ]);
Deleting a Hook
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->hooks->on('id-of-project')->remove('id-of-hook');
Managing Deployments
The simple way to manage project deployments through the SDK:
List all Deployments
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->deployments->on('id-of-project')->all();
Pushing a new Deployment
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); // Default Deployment $envoyer->deployments->on('id-of-project')->deploy(); // Deployment from branch $envoyer->deployments->on('id-of-project')->deploy([ 'from' => 'branch', 'branch' => 'develop' ]); // Deployment from tag $envoyer->deployments->on('id-of-project')->deploy([ 'from' => 'tag', 'tag' => 'v2.0.0' ]);
Getting a single Deployment
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->deployments->on('id-of-project')->first('id-of-deployment');
Cancel a Deployment
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->deployments->on('id-of-project')->cancel('id-of-deployment');
Managing Collaborators
The simple way to manage project collaborators through the SDK
List all Collaborators
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->collaborators->on('id-of-project')->all();
Invite a new Collaborator
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->collaborators->on('id-of-project')->invite([ 'email' => 'test@email.com' ]);
Get a single Collaborator
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->collaborators->on('id-of-project')->first('id-of-collaborator');
Remove a Collaborator
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->collaborators->on('id-of-project')->remove('id-of-collaborator');
Managing Notifications
The simple way to manage project notifications through the SDK:
List all Notifications
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->notifications->on('id-of-project')->all();
Create a new Notification
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); // Create an Email Notification $envoyer->notifications->on('id-of-project')->create([ 'name' => 'Notification Name', 'type' => 'email', // email, discord, slack, teams 'email_address' => 'test@email.com' ]); // Create a Discord Notification $envoyer->notifications->on('id-of-project')->create([ 'name' => 'Notification Name', 'type' => 'discord', // email, discord, slack, teams 'discord_webhook' => 'url-of-webhook' ]); // Create a Slack Notification $envoyer->notifications->on('id-of-project')->create([ 'name' => 'Notification Name', 'type' => 'slack', // email, discord, slack, teams 'slack_webhook' => 'url-of-webhook' ]); // Create a Teams Notification $envoyer->notifications->on('id-of-project')->create([ 'name' => 'Notification Name', 'type' => 'teams', // email, discord, slack, teams 'teams_webhook' => 'url-of-webhook' ]);
Get a single Notification
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->notifications->on('id-of-project')->first('id-of-notification');
Modify a Notification
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->notifications->on('id-of-project')->modify('id-of-notification', [ 'name' => 'Send Someone an email', 'type' => 'email', 'email_address' => 'test@email.com' ]);
Remove a Notification
use JustSteveKing\Laravel\Envoyer\SDK\Envoyer; $envoyer = Envoyer::illuminate( API_TOKEN_HERE, 'https://envoyer.io/' // this is optional as is the default ); $envoyer->notifications->on('id-of-project')->remove('id-of-notification');
juststeveking/laravel-envoyer-sdk 适用场景与选型建议
juststeveking/laravel-envoyer-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 60.36k 次下载、GitHub Stars 达 39, 最近一次更新时间为 2020 年 11 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sdk」 「laravel」 「envoyer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 juststeveking/laravel-envoyer-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 juststeveking/laravel-envoyer-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 juststeveking/laravel-envoyer-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A tool to help package release commits for Sentry.
A Laravel package to add Envoyer deploy commands to your application.
JustPark Envoyer Deploy Command
Sync the translation files for laravel when the site uses envoyer
JustPark's Envoyer Deploy Command updated for Laravel 5/6/7/8
Alfabank REST API integration
统计信息
- 总下载量: 60.36k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 39
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2020-11-04
