-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c9f082
commit 2fb46ec
Showing
2 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# Laravel TransIP Rest Client - Wrapper | ||
|
||
A very easy way to use the TransIP Rest API in your Laravel 6.x & 7.x Project. | ||
A very easy way to use the TransIP Rest API in your Laravel Project. | ||
|
||
[![Latest Version on Packagist](https://img.shields.io/packagist/v/intvent/transip-laravel.svg?style=flat-square)](https://packagist.org/packages/intvent/transip-laravel) | ||
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/intvent/transip-laravel.svg?style=flat-square)](https://packagist.org/packages/intvent/transip-laravel) | ||
|
||
# Installation | ||
## Installation | ||
|
||
First add your API credentials into your .env file. | ||
```bash | ||
|
@@ -17,21 +17,23 @@ TRANSIP_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----<your_private_key_here-----END P | |
TRANSIP_WHITELIST_ONLY=false | ||
``` | ||
|
||
# Install through composer | ||
## Install with composer | ||
|
||
```bash | ||
composer require intvent/transip-laravel | ||
``` | ||
|
||
Next up the service provider must be registered: | ||
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: | ||
```php | ||
'providers' => [ | ||
... | ||
IntVent\TransIPLaravel\TransIPServiceProvider::class, | ||
]; | ||
``` | ||
|
||
Optionally the IntVent\TransIPLaravel\GoogleCalendarFacade must be registered: | ||
Optionally the IntVent\TransIPLaravel\GoogleCalendarFacade can be registered: | ||
```php | ||
'aliases' => [ | ||
... | ||
|
@@ -63,4 +65,52 @@ return [ | |
'generateWhitelistOnlyTokens' => env('TRANSIP_WHITELIST_ONLY', true), | ||
|
||
]; | ||
``` | ||
``` | ||
|
||
## Usage | ||
|
||
Using the Facade | ||
```php | ||
<?php | ||
|
||
use TransIP; | ||
|
||
// Get all VPS from your account. | ||
$allVps = TransIP::vps()->getAll(); | ||
``` | ||
|
||
Using the auto IoC binding | ||
|
||
```php | ||
<?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(); | ||
} | ||
} | ||
``` | ||
|
||
## Security | ||
|
||
If you discover any security-related issues, please email [email protected] instead of using the issue tracker. | ||
|
||
## Credits | ||
|
||
- [Peter Steenbergen](https://github.com/petericebear) | ||
- [All Contributors](../../contributors) | ||
|
||
## License | ||
|
||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters