Laravel Envoyer API Package

Packages

November 13th, 2020

laravel-envoyer-sdk-featured.png

Laravel Envoyer SDK is a community package by Steve McDougall to work with the Laravel Envoyer API. Laravel released an API for Envoyer on November 4th, which allows users to interact with Envoyer via a REST API.

If you want to have a play with this API, you can even use this handy SDK I whipped together for you #php #phpc #laravel https://t.co/mFiTm2Qrw6 https://t.co/PBx7EYSZd5

— Steve McDougall (@JustSteveKing) November 4, 2020

Here’s how you can get an instance of the API client:

1use JustSteveKing\Laravel\Envoyer\SDK\Envoyer;
2 
3$envoyer = Envoyer::illuminate(
4 API_TOKEN_HERE,
5 'https://envoyer.io/' // this is optional as is the default
6);

Once you have an instance of the client, you can perform calls for the various Envoyer API endpoints:

1// Get all projects
2$envoyer->projects->all();
3 
4// Create a project
5$envoyer->projects->save([
6 'name' => 'SDK test',
7 'provider' => 'github', // bitbucket, github, gitlab, gitlab-self
8 'type' => 'laravel-5', // laravel-5. laravel-4, other
9 'repository' => 'laravel/laravel',
10 'branch' => 'master'
11]);
12 
13// Find a project by ID
14$envoyer->projects->find('id-of-project');
15 
16// Modify a project
17$envoyer->projects->modify('id-of-project', [
18 'name' => 'Project name update through SDK',
19]);

You can perform the following types of actions with this SDK:

  • Manage projects
  • Manage servers
  • Manage project environments
  • Manage action hooks
  • Manage deployments
  • Manage collaborators
  • Manage notifications

Learn More

You can learn more about this package, get full installation instructions, and view the source code on GitHub at JustSteveKing/laravel-envoyer-sdk. Laravel released API Documentation for the new Envoyer API that you can reference for details on getting started with the API.

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.