laravel,how i can change the code to return an array?
<p>i have this controller which access the pivot table in many to many relationships. the columns in the pivot table are values and created_at. i want this controller to return me an array of values and created_at</p>

<pre><code>public function status($s_type)
{

    $o_health_status = Status::where('name', 'health')-&gt;first();
    $o_speed_status = Status::where('name', 'speed')-&gt;first();

    if ($s_type === 'health'){

        $o_response = $this-&gt;statuses()-&gt;where('status_id', $o_health_status-&gt;id)
        -&gt;select('values','created_at')-&gt;orderBy('created_at','ASC')-&gt;first();

        if($o_response === null){
            return 'unsigned';
        }
        $o_response = $o_response-&gt;values;
        return $o_response;         
    }else{

        $o_response = $this-&gt;statuses()-&gt;where('status_id', $o_speed_status-&gt;id)
        -&gt;select('values','created_at')-&gt;orderBy('created_at', 'desc')-&gt;first();
        if($o_response === null){
            return 'unsigned';
        }

        $o_response = $o_response-&gt;values;
        return $o_response;


    }
</code></pre>