title: Table pagination trouble on Laravel
body: <p>I'm facing some trouble at pagination on laravel. Already paginate the table. But in view page the numbers are not okay.This is how it's look like: </p>
  
  <p><a href="https://i.stack.imgur.com/407Oo.png" rel="nofollow noreferrer">https://i.stack.imgur.com/407Oo.png</a></p>
  
  <p>The other problem is when I press the numbers, links are dead and giving me this error: </p>
  
  <blockquote>
    <p>Symfony \ Component \ HttpKernel \ Exception \
    MethodNotAllowedHttpException No message</p>
  </blockquote>
  
  <p><strong>This my route:</strong> </p>
  
  <pre><code>Route::get("/", "PagesController@welcome");
  
  Route::post("/search", "PagesController@search")-&gt;name('search.route');
  </code></pre>
  
  <p><strong>And this my view:</strong> </p>
  
  <pre><code>public function search(Request $request)
      {
          $q = $request-&gt;q;
          if ($q !== null &amp;&amp; trim($q) !== ""){//here
  
              $estates = \DB::table('allestates')
                  -&gt;where("building_name","LIKE", "%" . $q . "%")
                  -&gt;orWhere("address","LIKE", "%" . $q . "%")
                  -&gt;orWhere("company_name","LIKE", "%" . $q . "%")
                  -&gt;orWhere("region","LIKE", "%" . $q . "%")
                  -&gt;orderBy('price')-&gt;paginate(10);
  
  
              if(count($estates) &gt; 0){
                  return view("search", compact('estates'))-&gt;withQuery($q);
              }
  
          }
  
          $estates = array();//here
          return view("search", compact('estates'))-&gt;withMessage("No Found!");//here
      }
  </code></pre>
  
  <p>The other thing is in controller I can't add <code>-&gt;paginate(10)</code> with <code>-&gt;get()</code>  it's returning as a error like: </p>
  
  <blockquote>
    <p>Method Illuminate\Support\Collection::paginate does not exist.</p>
  </blockquote>
  
  <p>I really appreciate any help to solve this problems. Thank you!
  By the way if connected or not I don't know, but I already deleted/changed "boostrap" file in public.  </p>