i have a select that returns a integer value but in the variable it is stored a object that is obvious i neeed to convert to integer
$n = DB::select(‘select top 1 id form tags order by id DESC’);
then i need to convert $n to integer
Advertisement
Answer
This easy to do with ORM, if you have Tag
model please try,
$n = Tag::orderBy('id','desc')->first()->id;