Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.
/ laravel-ohdear Public archive

Easily integrate the Oh Dear API into a Laravel app

License

Notifications You must be signed in to change notification settings

ohdearapp/laravel-ohdear

Repository files navigation

Easily integrate the Oh Dear API into a Laravel app

Latest Version on Packagist Build Status Quality Score StyleCI Total Downloads

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.

Installation

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', ''),
];

Usage

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.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.