Skip to content
This repository has been archived by the owner on Nov 10, 2018. It is now read-only.

ohdearapp/laravel-forge-sync

Repository files navigation

THIS PACKAGE HAS BEEN ABANDONED, DO NOT USE

Import Laravel Forge sites to Oh Dear!

Build Status StyleCI Quality Score Total Downloads

This package allows you to easily import your Laravel Forge sites to your Oh-Dear! App account.

Screencast of Usage

At the moment it will only import sites from Forge to Oh Dear!

Installation

You can install the package via composer:

composer require ohdear/forge-sync

You must publish the configuration file with:

php artisan vendor:publish --provider="OhDear\ForgeSync\ForgeSyncServiceProvider"

This is the content of the file that will be published at config/forge-sync.php. You should provide an Oh Dear! API token and a Forge API token.

return [

    /*
     * An Oh Dear! API token.
     *
     * Learn how to get an API token at the Oh Dear! docs
     * https://ohdear.app/docs/api/authentication
     */
    'ohdear_api_token' => '',

    /*
     * A Forge API token.
     *
     * You can create an API token here:
     * https://forge.laravel.com/user/profile#/api
     */
    'forge_api_token' => '',

];

Usage

Run this command to start the import process. It will ask you which Forge sites should be imported to which Oh Dear! team.

php artisan ohdear:forge-sync

Alternatively you could also run this piece of code:

use OhDear\ForgeSync\ForgeSync;
use OhDear\ForgeSync\Site;

$forgeSync = new ForgeSync(
   $ohDearTeamId,
   $ohDearApiToken,
   $forgeApiToken
);

$forgeSync->sites()->each(function(Site $site) {
    $forgeSync->addToOhDear($site);
});

Skipping sites

If you have a site on Forge that you do not wish to import into Oh Dear! simply add this line to the Nginx config of that site.

#OH-DEAR-DO-NOT-MONITOR

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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