title: Call to a member function links() on array in laravel
body: <p>I dont know what happens. I am using pagination but it gives me error
  like:- Call to a member function links() on array</p>
  
  <p>Here is My code 
  Function:-</p>
  
  <pre><code>enter code here
  
  
  use Illuminate\Pagination\LengthAwarePaginator;
      public function index(){
         $data =  DB::table('tasks')-&gt;paginate(1);
          $data= json_decode(json_encode($data),true); 
          return view('index',['data'=&gt;$data]);
      }
  </code></pre>
  
  <p>And i used in blade file in end where foreach finish:-</p>
  
  <pre><code>enter code here
  {{ $data-&gt;links() }}
  </code></pre>