PHP code example of viicslen / laravel-trackable-tasks
1. Go to this page and download the library: Download viicslen/laravel-trackable-tasks 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/ */
viicslen / laravel-trackable-tasks example snippets
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use ViicSlen\TrackableTasks\Concerns\TrackAutomatically;
class TestJobWithTracking implements ShouldQueue
{
use InteractsWithQueue;
use Queueable;
use Dispatchable;
use TrackAutomatically;
public function handle(): void {
$this->taskSetProgressMax(200);
$this->taskIncrementProgress();
sleep(1);
$this->taskIncrementProgress(10);
sleep(1);
$this->taskIncrementProgress(20);
sleep(1);
$this->taskIncrementProgress(30);
sleep(1);
$this->taskFinishProgress();
}
}