title: Call to undefined method stdClass::links()
body: <p>I am sending a request to a web API, which responses with an encoded paginated response, I am receiving the response and decoding it successfully. The response looks like the following:</p>
  
  <pre><code>{#225 ▼
    +"message": "تم بنجاح"
    +"code": "1"
    +"data": {#220 ▼
      +"current_page": 1
      +"data": array:10 [▶]
      +"from": 1
      +"last_page": 2
      +"next_page_url": "http://localhost:8000/api/getpostsadmin?page=2"
      +"path": "http://localhost:8000/api/getpostsadmin"
      +"per_page": 10
      +"prev_page_url": -1
      +"to": 10
      +"total": 11
    }
  } 
  </code></pre>
  
  <p>Bellow is a part of the controller code:</p>
  
  <pre><code>  if ($response-&gt;code=='1')
              {
  //                dd($response-&gt;data);
                  $data=$response-&gt;data;
  
  //
  //                dd($data);
                   return view('posts',compact('data'));
              }
  </code></pre>
  
  <p>and here is the view code:</p>
  
  <pre><code> &lt;div class="table-responsive"&gt;
                      &lt;table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"&gt;
                          &lt;thead&gt;
                          &lt;tr&gt;
                              &lt;th&gt;ID&lt;/th&gt;
                              &lt;th&gt;Title AR&lt;/th&gt;
                              &lt;th&gt;Title EN&lt;/th&gt;
                              &lt;th&gt;Description AR&lt;/th&gt;
                              &lt;th&gt;Description EN&lt;/th&gt;
                              &lt;th&gt;Created At&lt;/th&gt;
                          &lt;/tr&gt;
                          &lt;/thead&gt;
                          &lt;tfoot&gt;
                          &lt;tr&gt;
                              &lt;th&gt;ID&lt;/th&gt;
                              &lt;th&gt;Title AR&lt;/th&gt;
                              &lt;th&gt;Title EN&lt;/th&gt;
                              &lt;th&gt;Description AR&lt;/th&gt;
                              &lt;th&gt;Description EN&lt;/th&gt;
                              &lt;th&gt;Created At&lt;/th&gt;
                          &lt;/tr&gt;
                          &lt;/tfoot&gt;
                          &lt;tbody&gt;
                          @foreach($data-&gt;data as $datum)
                          &lt;tr&gt;
                              &lt;td&gt;{{$datum-&gt;id}}&lt;/td&gt;
                              &lt;td&gt;{{$datum-&gt;title_ar}}&lt;/td&gt;
                              &lt;td&gt;{{$datum-&gt;title_en}}&lt;/td&gt;
                              &lt;td&gt;{{$datum-&gt;description_ar}}&lt;/td&gt;
                              &lt;td&gt;{{$datum-&gt;description_en}}&lt;/td&gt;
                              &lt;td&gt;{{$datum-&gt;created_at}}&lt;/td&gt;
                          &lt;/tr&gt;
                          @endforeach
  
  
  
                          &lt;/tbody&gt;
                      &lt;/table&gt;
                      {!! $data-&gt;links() !!}
                  &lt;/div&gt;
  </code></pre>
  
  <p>Why this error is always appearing?
  I tried <code>render()</code> method instead and  <code>{!! $data-&gt;data-&gt;links() !!}</code>,
  but nothing worked.</p>
  
  <p>The API code that returns the response is:</p>
  
  <pre><code>$post=post::orderBy('created_at','asc')-&gt;paginate(10); $post=$post-&gt;toArray(); $post=public_functions::remove_nulls($post); 
  return response()&gt;json(["message"=&gt;"success","code"=&gt;'1','data'=&gt;$post]);
  </code></pre>