Method Illuminate\Database\Eloquent\Collection::paginate does not exist.
On this query paginate(100) causes the error above
$listings = Auth::user()->listings
->where('availability', 'Y')
->sortBy('title')
->paginate(100);
however on the query below it does not
$listings = Listing::where('availability', 'Y')
->where('user_id', Auth::id())
->where(function ($query) use ($Isbn){
$query->where('isbn13', $Isbn)
->orWhere('isbn', $Isbn);
})
->orderBy('title', 'asc')
->paginate(100);
I "dd'd" both listings and observed they are of the same type! I can still share the exact results if someone would like. They are both collections of listings.
Any thoughts on how I can paginate the first query? My initial reaction is maybe there is an issue with using eloquent has many relationships then paginating.