PHP code example of kima92 / expector-patronum

1. Go to this page and download the library: Download kima92/expector-patronum 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/ */

    

kima92 / expector-patronum example snippets



$group = Group::query()->create(['name' => 'bla', 'color' => 'green']);
$expector = new Expector();

$plan = $expector->generatePlan('transmit 231', '0 20 * * *', $group, [['type' => StartedInTimeCheck::RULE_NAME]]);

$expector->generateNextExpectations(CarbonImmutable::create(2024), CarbonImmutable::create(2024, day: 2));

ExpectorPatronum::runTask('my Task', fn() => sleep(5));

ExpectorPatronum::authWith(fn (Request $request) => !$this->app->environment('production') && $request->user())

ExpectorPatronum::setExpectationUuidResolver(fn () => Str::uuid()->toString())
bash
php artisan vendor:publish --tag="expector-patronum-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="expector-patronum-config"
bash
php artisan vendor:publish --tag="expector-patronum-views"