homedoctor-es / laravel-holded
Laravel integration of the [Holded PHP SDK](https://github.com/homedoctor-es/holded-php-sdk).
Installs: 2 121
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.0.0
- homedoctor-es/holded-php-sdk: 1.0.3
- illuminate/support: >=5.7
README
Laravel integration for the Holded SDK.
Installation
The preferred way to install this extension is through composer.
With Composer installed, you can then install the extension using the following commands:
$ php composer.phar require homedoctor-es/laravel-holded
or add
... "require": { "homedoctor-es/laravel-holded": "*" }
to the require
section of your composer.json
file.
Configuration
- Register the ServiceProvider in your config/app.php service provider list.
config/app.php
return [ //other stuff 'providers' => [ //other stuff \HomedoctorEs\Laravel\Holded\HoldedServiceProvider::class, ]; ];
- If you want, you can add the following facade to the $aliases section.
config/app.php
return [ //other stuff 'aliases' => [ //other stuff 'Holded' => \HomedoctorEs\Laravel\Holded\Facades\Holded::class, ]; ];
- Publish the Holded provider
php artisan vendor:publish --provider="HomedoctorEs\Laravel\Holded\HoldedServiceProvider"
- Set the reference, api_key and base_url in the config/holded.php file.
config/holded.php
return [ 'api_key' => env('HOLDED_API_KEY'), 'base_url' => env('HOLDED_BASE_URL', 'https://api.holded.com/api/'), ];
- Or use .env file
HOLDED_API_KEY=
HOLDED_BASE_URL=https://api.holded.com/api/
Usage
You can use the facade alias Holded to execute services of the Holded sdk. The authentication params will be automatically injected.
$contacts = \HomedoctorEs\Laravel\Holded\Facades\Holded::contact();
Or use Laravel Service Container to get The Holded Instance.
app(\HomedoctorEs\Laravel\Holded\Holded::class)->contact();
Once you have done this steps, you can use all Holded SDK endpoints as are described in the sdk package documentation.