1. Go to this page and download the library: Download pharaonic/laravel-executor 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/ */
pharaonic / laravel-executor example snippets
use App\Jobs\RecalculateRatings;
use Pharaonic\Laravel\Executor\Classes\Executor;
use Pharaonic\Laravel\Executor\Enums\ExecutorType;
return new class () extends Executor {
public $type = ExecutorType::ONCE;
public $tags = ['cache'];
public $servers = [];
public function up(): void
{
$this->command('optimize');
$this->job(RecalculateRatings::class, 'electronics')->onQueue('ratings');
}
public function down(): void
{
$this->command('optimize:clear');
}
};