Lae/app/Jobs/Host/RealHostCostJob.php

41 lines
823 B
PHP
Raw Normal View History

2023-01-17 08:07:55 +00:00
<?php
namespace App\Jobs\Host;
use App\Models\Host;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class RealHostCostJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public Host $host;
public string $price;
/**
* Create a new job instance.
*
* @param Host $host
* @param string $price
*/
public function __construct(Host $host, string $price)
{
$this->host = $host;
$this->price = $price;
}
/**
* Execute the job.
*
* @return void
*/
public function handle(): void
{
$this->host->cost($this->price);
}
}