Made a query to the database:

$val = DB::table('users')->select('downloads')->where('id', 1)->get(); 

And received:

 [{"downloads":3}] 

How to get 3 ?

    1 answer 1

    Judging by the conclusion: $val[0]->downloads

    • ErrorException: Cannot use object of type stdClass as array - Mike Waters
    • @MikeWaters, ah, I repent, corrected the answer. my mistake. - ya.ymer