Add asset to collection
devloe opened this issue · comments
Juan Pablo Lozano commented
Is it possible to add a specfic asset to a collection?
Like so
Assets::add([asset-path], [collection-name]);
Javi 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)