I am trying to get only integer value (serial id) without a column name, which makes it a string. I am working in Laravel so I can use Laravel functions for SQL queries if necessary.
$idcko = DB::table('repairs')
->select('id')
->latest();
So when I print idcko I get something like {"column name": 2}
Where I want only number 2.
UPDATE:
With help of answers, I came up with this idea:
$idcko = DB::table('repairs')
->select('id')
->orderBy('id','desc')
->first()
->id;
Because I was getting error that I don't have a timestamp column and I wanted to get the newest / highest id, I could do a little trick and order it by id and select only first row.