I have the following query in Laravel :
$cat_get = DB::table('aimcats as a')
->join('subcat as s', 's.cat_id', '=' , 'a.id')
->where('s.id', $subcat)
->select('a.id as categ_id')
->first();
The vardump for $cat_get is this :
object(stdClass)#392 (1) { ["categ_id"]=> int(502) }
I need to change the 502 to a number without the object to be able to save it in the database.
As of now I'm receiving this error
Object of class stdClass could not be converted to string