2023-03-20 12:04:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Jobs;
|
|
|
|
|
2023-03-21 09:32:16 +00:00
|
|
|
use App\Actions\RemoteProcess\RemoteProcess;
|
2023-03-20 12:04:22 +00:00
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
use Spatie\Activitylog\Contracts\Activity;
|
|
|
|
|
|
|
|
class ExecuteCoolifyProcess implements ShouldQueue
|
|
|
|
{
|
|
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new job instance.
|
|
|
|
*/
|
|
|
|
public function __construct(
|
|
|
|
public Activity $activity,
|
|
|
|
){}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute the job.
|
|
|
|
*/
|
2023-03-21 09:08:36 +00:00
|
|
|
public function handle(): void
|
2023-03-20 12:04:22 +00:00
|
|
|
{
|
2023-03-21 09:08:36 +00:00
|
|
|
$remoteProcess = resolve(RemoteProcess::class, [
|
|
|
|
'activity' => $this->activity,
|
2023-03-20 14:04:35 +00:00
|
|
|
]);
|
|
|
|
|
2023-03-21 09:08:36 +00:00
|
|
|
$remoteProcess();
|
2023-03-20 12:04:22 +00:00
|
|
|
}
|
|
|
|
}
|