lasthourcloud/app/Http/Livewire/PollActivity.php
2023-03-28 22:13:08 +02:00

28 lines
622 B
PHP

<?php
namespace App\Http\Livewire;
use Livewire\Component;
use Spatie\Activitylog\Models\Activity;
class PollActivity extends Component
{
public $activity;
public $activity_log_id;
public $isKeepAliveOn = true;
public function mount() {
$this->activity = Activity::find($this->activity_log_id);
}
public function polling()
{
$this->activity?->refresh();
if (data_get($this->activity, 'properties.exitCode') !== null) {
$this->isKeepAliveOn = false;
}
}
public function render()
{
return view('livewire.poll-activity');
}
}