outl1ne / nova-page-manager

Static page and region manager for Laravel Nova - designed for headless CMS's.
MIT License
180 stars 39 forks source link

allow unique keys for collectAndReplaceUsing() #136

Closed kaareloun closed 2 years ago

kaareloun commented 2 years ago

Allows duplicate keys in collectAndReplaceUsing, so you can do this in your template without worrying about duplicates. Currently it will throw exception on duplicates

return $this->collectAndReplaceUsing($page->data ?? [], [
  ...BlockOne::mediaPaths(),
  ...BlockTwo::mediaPaths(),
], Media::class, fn ($image) => ThumborImage::make($image));