Files
shipping-portal/app/Classes/Modules/Orders/Services/ChecksIfOrderNumberExists.php
T

28 lines
505 B
PHP

<?php
namespace App\Classes\Modules\Orders\Services;
use App\Models\Order;
class ChecksIfOrderNumberExists
{
/** @var Order */
private $repository;
/**
* ChecksIfBookingMarkingExists constructor.
* @param Order $repository
*/
public function __construct(Order $repository)
{
$this->repository = $repository;
}
public function execute(int $orderNumber): bool {
return $this->repository->where('reference', $orderNumber)->exists();
}
}