<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>laravel5.5 Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/laravel5-5/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/laravel5-5/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 15 May 2021 10:56:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Laravel 5.5 Method paginate does not exist</title>
		<link>https://www.scmgalaxy.com/tutorials/laravel-5-5-method-paginate-does-not-exist/</link>
		
		<dc:creator><![CDATA[Chandan Kumar]]></dc:creator>
		<pubDate>Sat, 15 May 2021 10:53:03 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[laravel5.5]]></category>
		<category><![CDATA[Method]]></category>
		<category><![CDATA[Php]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=6282</guid>

					<description><![CDATA[<p>When I am trying to put some value in my input search box and after pressing enter button showing above [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/laravel-5-5-method-paginate-does-not-exist/">Laravel 5.5 Method paginate does not exist</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="229" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/method-paginate-does-not-exist-1024x229.jpg" alt="" class="wp-image-6283" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/method-paginate-does-not-exist-1024x229.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/method-paginate-does-not-exist-300x67.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/method-paginate-does-not-exist-768x172.jpg 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/method-paginate-does-not-exist.jpg 1268w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">When I am trying to put some value in my input search box and after pressing enter button showing above issue.<br>But when I am trying to filter data with my search button then it&#8217;s working fine. so i dig into it. i found one solution on it.</p>



<h5 class="wp-block-heading">FilterController.php</h5>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
$users = DB::table(&#039;users&#039;)
-&gt;where(function($query) use ($countryId, $stateId, $cityId) {
	if (isset($countryId) &amp;amp;&amp;amp; $countryId !== null &amp;amp;&amp;amp; $countryId !== &#039;&#039; &amp;amp;&amp;amp; $stateId == &#039;Select State&#039;) {
		$query-&gt;where(&#039;country_id&#039;, &#039;=&#039;, $countryId);
	}
	if (isset($countryId) &amp;amp;&amp;amp; $countryId !== null &amp;amp;&amp;amp; $countryId !== &#039;&#039; &amp;amp;&amp;amp; isset($stateId) &amp;amp;&amp;amp; $stateId !== &#039;Select State&#039; &amp;amp;&amp;amp; $stateId !== &#039;&#039;) {
		$query-&gt;where(&#x5B;
							&#x5B;&#039;country_id&#039;, &#039;=&#039;, $countryId],
							&#x5B;&#039;state_id&#039;, &#039;&amp;lt;&gt;&#039;, $stateId]
						]);
		
	}
})-&gt;get()-&gt;paginate(5);
</pre></div>


<h4 class="wp-block-heading">Solution :</h4>



<p class="wp-block-paragraph">Just remove the get() and your code will work fine.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
$users = DB::table(&#039;users&#039;)
-&gt;where(function($query) use ($countryId, $stateId, $cityId) {
	if (isset($countryId) &amp;amp;&amp;amp; $countryId !== null &amp;amp;&amp;amp; $countryId !== &#039;&#039; &amp;amp;&amp;amp; $stateId == &#039;Select State&#039;) {
		$query-&gt;where(&#039;country_id&#039;, &#039;=&#039;, $countryId);
	}
	if (isset($countryId) &amp;amp;&amp;amp; $countryId !== null &amp;amp;&amp;amp; $countryId !== &#039;&#039; &amp;amp;&amp;amp; isset($stateId) &amp;amp;&amp;amp; $stateId !== &#039;Select State&#039; &amp;amp;&amp;amp; $stateId !== &#039;&#039;) {
		$query-&gt;where(&#x5B;
							&#x5B;&#039;country_id&#039;, &#039;=&#039;, $countryId],
							&#x5B;&#039;state_id&#039;, &#039;&amp;lt;&gt;&#039;, $stateId]
						]);
		
	}
})-&gt;paginate(5);
</pre></div>


<h4 class="wp-block-heading">References :</h4>



<ol class="wp-block-list"><li><a rel="noreferrer noopener" href="https://stackoverflow.com/questions/44980792/laravel-5-4-method-paginate-does-not-exist-multiple-relation-filter-and-ord" target="_blank">Click here</a></li><li><a href="https://stackoverflow.com/questions/48148472/laravel-method-paginate-does-not-exist" target="_blank" rel="noreferrer noopener">Click here</a></li></ol>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/laravel-5-5-method-paginate-does-not-exist/">Laravel 5.5 Method paginate does not exist</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
