how to read ajax response with multiple objects in laravel 5.2
<p>I am trying to get the multiple eloquent objects through controller json response when drop down is changed.</p>

<p><a href="https://i.stack.imgur.com/YYeFl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YYeFl.jpg" alt="enter image description here"></a></p>

<p>When cinema hall is changed then it should return 2 objects fetched from 2 different tables.</p>

<p>controller code</p>

<pre><code> public function getscreen($id)
{
    $screens=Movies_screen::where('cinema_id',$id)-&gt;get();
    $showtime=Movies_showtimes::where('cinema_id',$id)-&gt;get();

    return response()-&gt;json($screens);
}
</code></pre>

<p>my jquery ajax code </p>

<pre><code> $("#cinemahall").on("change click",function(){

var cinema_id=$("#cinemahall option:selected").val();
//ajax
    $.get('/askspidy/admin/showtime/getscreen/' + cinema_id, function(data){

        $("#screenname").empty();
        $("#screenname").append('&lt;option value=0&gt;Select Screen&lt;/option&gt;');

        $.each(data,function(index,screenobj){
            $("#screenname").append('&lt;option value="' +screenobj.screen_id + '"&gt;' +screenobj.screen_name +'&lt;/option&gt;');
        });
    });
});
</code></pre>

<p>The above code works fine when single eloquent object is sent i.e $screens , but as you can see in code there is another object i.e $showtime and i need to send the same with that request and read it in my jquery ajax code.</p>

<p>I tried in controller </p>

<pre><code> public function getscreen($id)
{
    $screens=Movies_screen::where('cinema_id',$id)-&gt;get();
    $showtime=Movies_showtimes::where('cinema_id',$id)-&gt;get();

    return response()-&gt;json($screens,$showtime);
}
</code></pre>

<p>and in jquery code</p>

<pre><code> $.get('/askspidy/admin/showtime/getscreen/' + cinema_id, function(data,data2)
</code></pre>

<p>but none of the solution worked. </p>