Skip to content

Commit

Permalink
- Add package discovery for Laravel >= 5.5
Browse files Browse the repository at this point in the history
- Update README
  • Loading branch information
divdax committed Jun 19, 2018
1 parent 482bc8f commit fd8751c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
## easybill.de REST API v1
# easybill.de REST API v1

**Unofficial** Laravel Package to use the [easybill.de REST API](https://www.easybill.de/api).

This Laravel Package is a very basic and untested version!

### Installation
## Installation

```
composer require divdax/easybill
```

### Laravel
## Laravel 5.5, 5.6

No need to register any providers / aliases. Thanks to Laravels Package Discovery.

## Laravel 5.4

Add the ServiceProvider and Facade in ```config/app.php```

Expand All @@ -26,20 +30,15 @@ Add the ServiceProvider and Facade in ```config/app.php```
];
```

Publish config file:
```
php artisan vendor:publish --provider="DivDax\Easybill\EasybillServiceProvider"
```

### Configuration
## Configuration

Add your easybill.de api key to your ```.env```

```
EASYBILL_API_KEY=xxxxxx
```

### Usage
## Usage

I only implemented some basic api calls

Expand Down Expand Up @@ -105,6 +104,6 @@ $doc->done();
Easybill::updateDocument($id, ['status' => 'DONE']);
```

### Contributing
## Contributing

If you find an issue, or have a better way to do something, feel free to open an issue or a pull request.
17 changes: 17 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"description": "Laravel Package to use the easybill.de REST API",
"keywords": ["laravel", "package", "easybill", "REST", "API"],
"license": "MIT",
"support": {
"issues": "https://github.com/divdax/easybill/issues",
"source": "https://github.com/divdax/easybill"
},
"authors": [
{
"name": "Heiko Klingele",
Expand All @@ -19,5 +23,18 @@
"require": {
"illuminate/support": "~5",
"guzzlehttp/guzzle": "^6.2"
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"DivDax\\Easybill\\EasybillServiceProvider"
],
"aliases": {
"Easybill": "DivDax\\Easybill\\Facade\\Easybill"
}
}
}
}
11 changes: 8 additions & 3 deletions src/EasybillServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ class EasybillServiceProvider extends ServiceProvider
{
public function boot()
{
$this->publishes([
__DIR__ . '/config/easybill.php' => config_path('easybill.php'),
], 'config');
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__ . '/config/easybill.php' => config_path('easybill.php'),
], 'config');
}
}

public function register()
Expand All @@ -19,7 +21,10 @@ public function register()
if(config('easybill.api_key') === null) {
throw new \Exception('Missing easybill.de API-Key in config!');
}

return new easybill(config('easybill.api_key'));
});

$this->mergeConfigFrom(__DIR__ . '/config/easybill.php', 'easybill');
}
}
1 change: 1 addition & 0 deletions src/easybill.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function __construct($api_key)
public function searchCustomer(array $parameters)
{
$this->response = $this->request->get('customers', $parameters);

return $this->response;
}

Expand Down

0 comments on commit fd8751c

Please sign in to comment.