Stolz / Assets

An ultra-simple-to-use assets management library for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add asset to collection

devloe opened this issue · comments

Is it possible to add a specfic asset to a collection?

Like so

Assets::add([asset-path], [collection-name]);

commented

No, it is not possible. Collections are immutable.

You will get the same effect if you run

Assets::add('collection-name')->add('asset-path');

If you still need the asset to be added to the specific collection instead of the whole assets stack, then you can replace the full collection with the function Assets::registerCollection('collectionName', $arrayOfassets)