Support the ongoing development of Laravel.io →
Architecture Blade
Last updated by @ajax30 1 month ago.
0

You need use the search query above the articles variable. Like this way.

Because everytime it will paginate for page wise. If you paginate for the second page it may not contain any data. That's why you are getting the 0 value for the other page. Please use this way, i think problem will be solved.

	// Search results count
	if ($request->input('search')) {
		$article_count = $articlesQuery->count();
	}	

$articles = $articlesQuery->orderBy('id', 'desc')->paginate($this->per_page);
0
Solution selected by @ajax30

@ajax30 Welcome. Please share the stackoverflow link so that i can reply to your question.

0

Sign in to participate in this thread!

Cloudways

Your banner here too?

Razvan ajax30 Joined 2 Oct 2021

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.