@tfevens You can access underlying collection easily:
$paginator = Article::paginate(10);
$paginator->count(); // 10
$paginator->getCollection()->shift();
$paginator->count(); // 9
In my app I'm currently displaying a list of articles, returned as an instance of Illuminate\Database\Eloquent\Collection. I can use $articles->shift() to grab the first article, and remove that from the Collection (displaying 2 articles, then an info box, and then looping through the remaining articles) without running into any issues.
However, now that I want to add pagination to the app, I'm being handed back an instance of Illuminate\Pagination\Paginator. This isn't allowing me to use $articles->shift() to pull the first 2 articles out. I'm not getting an error, but the same article is displayed three times.
Has anyone else ever come across this? If so, how did you go about working around it?
I have found out that if I modify Illuminate\Pagination\Paginator to extend Collection that everything works as I want, but this isn't really a viable option without it being added to the core Laravel files.
Any advice would be welcome!
Please or to participate in this conversation.