title: how to return json response in laravel
body: <p><strong>this is my controller:</strong></p>
  
  <pre><code>public function index(Request $request)
      {
          $items = Post::latest()-&gt;paginate(5);
          $cmnt = Comment::all();
  
          return response()-&gt;json(array('posts'=&gt;$items,'comment'=&gt;$cmnt));
      }
  </code></pre>
  
  <p><strong>this my ajax request</strong> </p>
  
  <pre><code>function getPageData() {
        $.ajax({
          dataType: 'json',
          url: "{{route('post_status.index')}}",
          data: {page:1}
        }).done(function(data){
              manageRow(data.data);
        });
      }
  function manageRow(data) {
            console.log(data.comment);
  }
  </code></pre>
  
  <p>why i am getting error ??
  help me out of this plzz</p>