Skip to content

semihcosu/laravel-appkeep

 
 

Repository files navigation

Official App:keep SDK for Laravel

Instantly discover problems with your Laravel sites.

Latest Version on Packagist Total Downloads GitHub Actions

This is the official Laravel SDK for App:keep

Installation

  • Supported PHP versions: 7.4, 8.0, 8.1
  • Supported Laravel versions: 7.x, 8.x, 9.x

Working with a different framework/PHP version? Shoot us an email at hello@appkeep.co.

1. Install the package via composer:

composer require appkeep/laravel-appkeep

2. Initialize Appkeep

php artisan appkeep:init

This will publish the config file and configure default checks. You can later change these default checks from app/Providers/AppkeepProvider.php.

💡 Important: Execute the following steps on your production environment.

3. Set up a cronjob

Make sure you have a cronjob that runs php artisan schedule:run every minute. App:keep relies on Laravel's scheduler. See Laravel's documentation to learn more.

4. Sign in to Appkeep

This step simply helps set your APPKEEP_KEY env variable. If you know the key, you can add it into your .env file yourself.

To sign in / register and create a project key, simply run:

php artisan appkeep:login

Commands

Here's other commands that you might find useful:

List all checks

Run this command to see a list of configured health checks:

php artisan appkeep:list

# +----------------+------------+
# | Check          | Expression |
# +----------------+------------+
# | DatabaseCheck  | * * * * *  |
# | DiskUsageCheck | * * * * *  |
# +----------------+------------+

Advanced

Customize checks

By default, Appkeep will register some default checks for you with some sensible defaults. You can adjust their warning and failure tresholds, or register your own checks in your app/Providers/AppServiceProvider.php file.

<?php

namespace App\Providers;

use Appkeep\Laravel\Checks\DiskUsageCheck;
use Appkeep\Laravel\Facades\Appkeep;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        // Uncomment this to remove all default checks
        // Appkeep::forgetDefaultChecks();

        Appkeep::checks([
            DiskUsageCheck::make()
                ->warnIfUsedPercentageIsAbove(60)
                ->failIfUsedPercentageIsAbove(70),

            // Register other checks, including custom ones...
        ]);
    }
}

Writing your own checks

TBD

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email hello@swiftmade.co instead of using the issue tracker.

Credits

License

The BSD-3-Clause License (BSD-3). Please see License File for more information.

About

App:keep Laravel SDK

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%