Skip to content

Commit

Permalink
Added README and LAravel 5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
petericebear committed Apr 19, 2020
1 parent 0c9f082 commit 2fb46ec
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 7 deletions.
62 changes: 56 additions & 6 deletions README.MD
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
Expand All @@ -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' => [
...
Expand Down Expand Up @@ -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.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "intvent/transip-laravel",
"description": "A Laravel wrapper for the TransIP REST API Client.",
"require": {
"illuminate/support": "^6.0|^7.0",
"php": "^7.2.0",
"illuminate/support": "^5.0|^6.0|^7.0",
"transip/transip-api-php": "^6.0"
},
"license": "MIT",
Expand Down

0 comments on commit 2fb46ec

Please sign in to comment.