AssetCollection is used to hold a collection of
This is not to be confused with an
AssetContainer, which is the “source” where assets and folders are located.
The examples on this page use simple values to make things easier to understand.
Creating a Collection
You can create an
AssetCollection in a similar fashion to a DataCollection or a regular collection.
$collection = collect_assets([1, 2, 3]);
Just like regular collections, the following methods can be chained for fluent manipulation of the underlying array.
This is just like a DataCollection’s
toArray method, except if any assets do not have corresponding
files, they will be filtered out from the array.