*/ protected Builder $query; /** * Cache name */ protected static string $cacheName = 'BANK_REPOSITORY'; /** * Bank repository */ public function __construct() { $this->query = Bank::query(); } /** * Return available options * * @return Collection|array */ public function options(): Collection|array { /** @var Collection */ $options = CacheRepository::make( name: static::$cacheName.'_options', value: fn () => $this->query->get(['id', 'name', 'bab'])->mapWithKeys(fn ($item) => [ $item->id => $item->name.' - '.$item->bab, ]), ); return $options; } }