Laravel eloquent skip() limit() use -


content::find($tag[0]->content_list)->take(5) $tag[0]->content_list =[1,7,9,11,16,23,35,56,77,87,93]

this works

but want use content::find($tag[0]->content_list)->take(5)->skip(5)

this throws error

by calling find() execute query , collection back. illuminate\support\collection class has take method, no skip method. that's what's happening here.

instead should call take() , skip() before use find():

content::take(5)->skip(5)->find($tag[0]->content_list); 

Comments