This package makes it easy to work with the Oh Dear! sdk in a Laravel app. Once configured you can call all the sdk methods on the OhDear
facade
\OhDear::sites(); // gets all sites
Also, the OhDear\PhpSdk\Resources\Site
will be bound to the site which url matches the one specified in the site_url
value of the oh-dear
config file.
You can install the package via composer:
composer require ohdearapp/laravel-ohdear
Next you must publish the config file. This is the content that will be published to config/oh-dear.php
:
return [
/*
* A valid API token for your Oh Dear! account. Instructions on how to get a
* token can be found on this page: https://ohdear.app/docs/api/authentication
*/
'api_token' => env('OH_DEAR_API_TOKEN', ''),
/*
* The url of your site as shown in Oh Dear.
* It should start with either 'http' or 'https'.
*/
'site_url' => env('OH_DEAR_SITE_URL', ''),
];
You can call all the sdk methods on the OhDear
facade:
\OhDear::sites(); // gets all sites
Take a look at the documentation of our php sdk to learn which methods are available.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.