PHP code example of arielmejiadev / healing-factor

1. Go to this page and download the library: Download arielmejiadev/healing-factor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arielmejiadev / healing-factor example snippets


use ArielMejiaDev\HealingFactor\Facades\HealingFactor;

public function boot(): void
{
    HealingFactor::auth(function ($user) {
        return in_array($user->email, [
            '[email protected]',
        ]);
    });
}

// routes/console.php
use Illuminate\Support\Facades\Schedule;

Schedule::command('healing-factor:recover-stale')->hourly();
Schedule::command('healing-factor:prune')->daily();

'categories' => [
    'quick_fixes' => [
        'timeout' => 1800,
        'max_turns' => 15,
        'exceptions' => [ErrorException::class, TypeError::class, ...],
    ],
    'complex_fixes' => [
        'timeout' => 3600,
        'max_turns' => 30,
        'exceptions' => [LogicException::class, RuntimeException::class, ...],
    ],
],

'ignored_exceptions' => [
    \OutOfMemoryError::class,
    \Illuminate\Http\Exceptions\ThrottleRequestsException::class,
    \Symfony\Component\HttpKernel\Exception\HttpException::class,
    \Illuminate\Session\TokenMismatchException::class,
],

use ArielMejiaDev\HealingFactor\Events\IssueResolved;

Event::listen(IssueResolved::class, function (IssueResolved $event) {
    // Send Slack notification, update status page, etc.
});
bash
php artisan healing-factor:install
bash
php artisan queue:work --timeout=3700
bash
php artisan healing-factor:test