I am getting quite desperate here. I can’t for the life of me figure out how to add an item to the end of a collection. I thought that is what
append() is for, but I can’t get it to work. I tried
extend() as well, they don’t work either.
What I need to do is to (additionally) add a collection’s first and second item to the collections end again.
Trying just to add the first item again, I tried:
$myFiles = page('landingpage')->files()->template('media')->sortBy('sort'); $myFiles->append($myFiles->first());
That does not work. What am I doing wrong?