Skip to content

Commit 2fb46ec

Browse files
committed
Added README and LAravel 5 support
1 parent 0c9f082 commit 2fb46ec

File tree

2 files changed

+58
-7
lines changed

2 files changed

+58
-7
lines changed

README.MD

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Laravel TransIP Rest Client - Wrapper
22

3-
A very easy way to use the TransIP Rest API in your Laravel 6.x & 7.x Project.
3+
A very easy way to use the TransIP Rest API in your Laravel Project.
44

55
[![Latest Version on Packagist](https://img.shields.io/packagist/v/intvent/transip-laravel.svg?style=flat-square)](https://packagist.org/packages/intvent/transip-laravel)
66
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
77
[![Total Downloads](https://img.shields.io/packagist/dt/intvent/transip-laravel.svg?style=flat-square)](https://packagist.org/packages/intvent/transip-laravel)
88

9-
# Installation
9+
## Installation
1010

1111
First add your API credentials into your .env file.
1212
```bash
@@ -17,21 +17,23 @@ TRANSIP_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----<your_private_key_here-----END P
1717
TRANSIP_WHITELIST_ONLY=false
1818
```
1919

20-
# Install through composer
20+
## Install with composer
2121

2222
```bash
2323
composer require intvent/transip-laravel
2424
```
2525

26-
Next up the service provider must be registered:
26+
This package will autoload the SrviceProvider and Facade listed below. If it does not automatically you can add it easily with the following steps.
27+
28+
Register the Service Provider:
2729
```php
2830
'providers' => [
2931
...
3032
IntVent\TransIPLaravel\TransIPServiceProvider::class,
3133
];
3234
```
3335

34-
Optionally the IntVent\TransIPLaravel\GoogleCalendarFacade must be registered:
36+
Optionally the IntVent\TransIPLaravel\GoogleCalendarFacade can be registered:
3537
```php
3638
'aliases' => [
3739
...
@@ -63,4 +65,52 @@ return [
6365
'generateWhitelistOnlyTokens' => env('TRANSIP_WHITELIST_ONLY', true),
6466

6567
];
66-
```
68+
```
69+
70+
## Usage
71+
72+
Using the Facade
73+
```php
74+
<?php
75+
76+
use TransIP;
77+
78+
// Get all VPS from your account.
79+
$allVps = TransIP::vps()->getAll();
80+
```
81+
82+
Using the auto IoC binding
83+
84+
```php
85+
<?php
86+
87+
use Transip\Api\Library\TransipAPI;
88+
89+
class TransipTestCommand extends Command
90+
{
91+
protected $signature = 'transip:test';
92+
93+
public function __construct()
94+
{
95+
parent::__construct();
96+
}
97+
98+
public function handle(TransipAPI $api))
99+
{
100+
$allVps = $api->vps()->getAll();
101+
}
102+
}
103+
```
104+
105+
## Security
106+
107+
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
108+
109+
## Credits
110+
111+
- [Peter Steenbergen](https://github.com/petericebear)
112+
- [All Contributors](../../contributors)
113+
114+
## License
115+
116+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "intvent/transip-laravel",
33
"description": "A Laravel wrapper for the TransIP REST API Client.",
44
"require": {
5-
"illuminate/support": "^6.0|^7.0",
5+
"php": "^7.2.0",
6+
"illuminate/support": "^5.0|^6.0|^7.0",
67
"transip/transip-api-php": "^6.0"
78
},
89
"license": "MIT",

0 commit comments

Comments
 (0)