Download the PHP package onlime/laravel-bexio-api-client without Composer
On this page you can find all versions of the php package onlime/laravel-bexio-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download onlime/laravel-bexio-api-client
More information about onlime/laravel-bexio-api-client
Files in onlime/laravel-bexio-api-client
Package laravel-bexio-api-client
Short Description Client library for Bexio API using Laravel HTTP Client
License MIT
Informations about the package laravel-bexio-api-client
Laravel Bexio API PHP Client
The bexio API Client Library enables you to work with the bexio API. This is a wrapper around onlime/bexio-api-client for easier Laravel integration using Laravel HTTP Client. You could use this in combination with my zero-configuration Laravel HTTP Client Global Logger for detailed request/response logging.
See onlime/bexio-api-client README and the official bexio API documentation for more information how to use the API.
Installation
You can use Composer to integrate the library into your Laravel project:
Sample Usage
NOTE: I am just documenting Laravel project integration here. Please consult the onlime/bexio-api-client README for Bexio API Client library documentation.
I recommend to make this thing configurable in config/bexio.php
:
Put your Bexio API credentials from Bexio Developer Portal into your .env
:
Create some secure storage to store the client (access and refresh) tokens, config/filesystems.php
:
You could then define these two routes in your routes/web.php
:
GET /admin/bexio/auth
– authenticate against Bexio and generate your access and refresh tokensGET /admin/bexio/demo
– demo page to test Bexio API with the previously generated access token
WARNING: Make sure you protect those rules and only make it available to your admin users!
Now create the controller, php artisan make:controller BexioController
:
NOTE: Make sure you add http://localhost:8080/admin/bexio/auth to the redirect URLs in Bexio Developer Portal
Now fire up your application:
Then, access the Bexio authentication page:
This will ask you to confirm the requested scopes and you will need to login with your Bexio credentials in case you haven't done this yet.
Once you have authenticated, you'll see the contents of the bexio.auth
view, which could display some confirmation message and ask you to proceed to the demo page. The demo page on http://localhost:8080/admin/bexio/demo will then use the Bexio API client tokens which were stored in <project-root>/storage/app/secure/bexio_client_tokens.json
, and display all Bexio contacts (as an example, to verify all is working).
Authors
Author of this awesome package is Philip Iezzi (Onlime GmbH).
License
This package is licenced under the MIT license however support is more than welcome.