<?php
namespace Illuminate\Bus;
use Carbon\CarbonImmutable;
use Illuminate\Container\Container;
use Illuminate\Support\Str;
use Illuminate\Support\Testing\Fakes\BatchFake;
trait Batchable
{
public $batchId;
private $fakeBatch;
public function batch()
{
if ($this->fakeBatch) {
return $this->fakeBatch;
}
if ($this->batchId) {
return Container::getInstance()->make(BatchRepository::class)?->find($this->batchId);
}
}