public function with($relations)
{
if (is_string($relations)) {
$relations = func_get_args();
}
$eagers = $this->parseWithRelations($relations);
$this->eagerLoad = array_merge($this->eagerLoad, $eagers);
return $this;
}
/** * @param int $publicId * * @return Order */ public function byPublicId(int $publicId) : Order { /** @var Order $order */ $order = $this->orderResource->with(self::DEFAULT_RELATIONS)->where('id', '=', Order::privateId($publicId))->first(); if ($order instanceof Order) { return $order; } return new Order(); }