I have a slider on the home page with the last 3 rows added here is my code and it's working perfectly, this is in my web.php route file and I'm passing it using compact('post')
$posts = Post::orderBy('created_at', 'desc')->take(3)->get();
After the slider I want to continue to display the rest of the post. So I need something like:
$olderPost = Post::orderBy('created_at', 'desc')-> Except the first 3 rows that I already used
try using skip and take as described in documentation
https://laravel.com/docs/5.3/queries
$posts = Post::orderBy('created_at', 'desc')->skip(3)->take(3)->get();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community