41 lines
823 B
PHP
41 lines
823 B
PHP
|
<?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);
|
||
|
}
|
||
|
}
|