{"id":6282,"date":"2021-05-15T10:53:03","date_gmt":"2021-05-15T10:53:03","guid":{"rendered":"https:\/\/www.scmgalaxy.com\/tutorials\/?p=6282"},"modified":"2021-05-15T10:56:45","modified_gmt":"2021-05-15T10:56:45","slug":"laravel-5-5-method-paginate-does-not-exist","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/","title":{"rendered":"Laravel 5.5 Method paginate does not exist"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" 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=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<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>\n\n\n\n<h5 class=\"wp-block-heading\">FilterController.php<\/h5>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$users = DB::table(&#039;users&#039;)\n-&gt;where(function($query) use ($countryId, $stateId, $cityId) {\n\tif (isset($countryId) &amp;amp;&amp;amp; $countryId !== null &amp;amp;&amp;amp; $countryId !== &#039;&#039; &amp;amp;&amp;amp; $stateId == &#039;Select State&#039;) {\n\t\t$query-&gt;where(&#039;country_id&#039;, &#039;=&#039;, $countryId);\n\t}\n\tif (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;) {\n\t\t$query-&gt;where(&#x5B;\n\t\t\t\t\t\t\t&#x5B;&#039;country_id&#039;, &#039;=&#039;, $countryId],\n\t\t\t\t\t\t\t&#x5B;&#039;state_id&#039;, &#039;&amp;lt;&gt;&#039;, $stateId]\n\t\t\t\t\t\t]);\n\t\t\n\t}\n})-&gt;get()-&gt;paginate(5);\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">Solution :<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Just remove the get() and your code will work fine.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$users = DB::table(&#039;users&#039;)\n-&gt;where(function($query) use ($countryId, $stateId, $cityId) {\n\tif (isset($countryId) &amp;amp;&amp;amp; $countryId !== null &amp;amp;&amp;amp; $countryId !== &#039;&#039; &amp;amp;&amp;amp; $stateId == &#039;Select State&#039;) {\n\t\t$query-&gt;where(&#039;country_id&#039;, &#039;=&#039;, $countryId);\n\t}\n\tif (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;) {\n\t\t$query-&gt;where(&#x5B;\n\t\t\t\t\t\t\t&#x5B;&#039;country_id&#039;, &#039;=&#039;, $countryId],\n\t\t\t\t\t\t\t&#x5B;&#039;state_id&#039;, &#039;&amp;lt;&gt;&#039;, $stateId]\n\t\t\t\t\t\t]);\n\t\t\n\t}\n})-&gt;paginate(5);\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">References :<\/h4>\n\n\n\n<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>\n","protected":false},"excerpt":{"rendered":"<p>When I am trying to put some value in my input search box and after pressing enter button showing above [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5049],"tags":[5305,4240,177],"class_list":["post-6282","post","type-post","status-publish","format-standard","hentry","category-laravel","tag-laravel5-5","tag-method","tag-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Laravel 5.5 Method paginate does not exist - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Laravel 5.5 Method paginate does not exist - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"When I am trying to put some value in my input search box and after pressing enter button showing above [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-15T10:53:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-15T10:56:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/method-paginate-does-not-exist-1024x229.jpg\" \/>\n<meta name=\"author\" content=\"Chandan Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Chandan Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-5-5-method-paginate-does-not-exist\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-5-5-method-paginate-does-not-exist\\\/\"},\"author\":{\"name\":\"Chandan Kumar\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/0990c0a2b3e841b474db853d83993e98\"},\"headline\":\"Laravel 5.5 Method paginate does not exist\",\"datePublished\":\"2021-05-15T10:53:03+00:00\",\"dateModified\":\"2021-05-15T10:56:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-5-5-method-paginate-does-not-exist\\\/\"},\"wordCount\":73,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-5-5-method-paginate-does-not-exist\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/method-paginate-does-not-exist-1024x229.jpg\",\"keywords\":[\"laravel5.5\",\"Method\",\"Php\"],\"articleSection\":[\"Laravel\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-5-5-method-paginate-does-not-exist\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-5-5-method-paginate-does-not-exist\\\/\",\"name\":\"Laravel 5.5 Method paginate does not exist - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-5-5-method-paginate-does-not-exist\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-5-5-method-paginate-does-not-exist\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/method-paginate-does-not-exist-1024x229.jpg\",\"datePublished\":\"2021-05-15T10:53:03+00:00\",\"dateModified\":\"2021-05-15T10:56:45+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/0990c0a2b3e841b474db853d83993e98\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-5-5-method-paginate-does-not-exist\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-5-5-method-paginate-does-not-exist\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-5-5-method-paginate-does-not-exist\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/method-paginate-does-not-exist.jpg\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/method-paginate-does-not-exist.jpg\",\"width\":1268,\"height\":284},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/laravel-5-5-method-paginate-does-not-exist\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Laravel 5.5 Method paginate does not exist\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/0990c0a2b3e841b474db853d83993e98\",\"name\":\"Chandan Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/74c343a5ceb90ca898e3d70936f38c44a8ce15becca310570da3b614131b436f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/74c343a5ceb90ca898e3d70936f38c44a8ce15becca310570da3b614131b436f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/74c343a5ceb90ca898e3d70936f38c44a8ce15becca310570da3b614131b436f?s=96&d=mm&r=g\",\"caption\":\"Chandan Kumar\"},\"description\":\"Be a Full Stack Developer and eager to learn new Technology. Knowledge: CSS, Bootstrap, Javascript, PHP, WordPress, Joomla, Moodle, Laravel, AJAX, Jquery, Java, Dart, Flutter, Photoshop, CorelDraw, Pagemaker &amp; Office Package\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/chandan\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Laravel 5.5 Method paginate does not exist - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/","og_locale":"en_US","og_type":"article","og_title":"Laravel 5.5 Method paginate does not exist - scmGalaxy","og_description":"When I am trying to put some value in my input search box and after pressing enter button showing above [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/","og_site_name":"scmGalaxy","article_published_time":"2021-05-15T10:53:03+00:00","article_modified_time":"2021-05-15T10:56:45+00:00","og_image":[{"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/method-paginate-does-not-exist-1024x229.jpg","type":"","width":"","height":""}],"author":"Chandan Kumar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Chandan Kumar","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/"},"author":{"name":"Chandan Kumar","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/0990c0a2b3e841b474db853d83993e98"},"headline":"Laravel 5.5 Method paginate does not exist","datePublished":"2021-05-15T10:53:03+00:00","dateModified":"2021-05-15T10:56:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/"},"wordCount":73,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/method-paginate-does-not-exist-1024x229.jpg","keywords":["laravel5.5","Method","Php"],"articleSection":["Laravel"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/","name":"Laravel 5.5 Method paginate does not exist - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/method-paginate-does-not-exist-1024x229.jpg","datePublished":"2021-05-15T10:53:03+00:00","dateModified":"2021-05-15T10:56:45+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/0990c0a2b3e841b474db853d83993e98"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/method-paginate-does-not-exist.jpg","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/method-paginate-does-not-exist.jpg","width":1268,"height":284},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/laravel-5-5-method-paginate-does-not-exist\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Laravel 5.5 Method paginate does not exist"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/0990c0a2b3e841b474db853d83993e98","name":"Chandan Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/74c343a5ceb90ca898e3d70936f38c44a8ce15becca310570da3b614131b436f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/74c343a5ceb90ca898e3d70936f38c44a8ce15becca310570da3b614131b436f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/74c343a5ceb90ca898e3d70936f38c44a8ce15becca310570da3b614131b436f?s=96&d=mm&r=g","caption":"Chandan Kumar"},"description":"Be a Full Stack Developer and eager to learn new Technology. Knowledge: CSS, Bootstrap, Javascript, PHP, WordPress, Joomla, Moodle, Laravel, AJAX, Jquery, Java, Dart, Flutter, Photoshop, CorelDraw, Pagemaker &amp; Office Package","url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/chandan\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/6282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=6282"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/6282\/revisions"}],"predecessor-version":[{"id":6284,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/6282\/revisions\/6284"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=6282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=6282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=6282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}