Category : paginate

public function show($id) { $post = Post::find($id); $comments = $post->comments()->orderBy(‘created_at’, ‘desc’)->get()->transform(function ($item, $key) { $item->registered = $item->created_at->diffForHumans(); return $item; }); return view(‘blog_views.post’)->with([‘post’ => $post, ‘comments’ => $comments]); } I want to add paginate(5) on $comments before return it to view and keep this values accessible in the view. {{ $comment->user->name }} relationship returning the creator ..

Read more

I built an application using Laravel 7 and I am facing some problems when using infinite scroll and paginate. Actually, the problem is when I add the URL information on the links of the paginate using this: {{ $properties->withQueryString()->query())->links() }} I also tried using this {{ $properties->withQueryString()->query())->links() }} with no sucess. My paginate only works ..

Read more