Using Laravel 5.8 I just want to fetch the work_order_no from table and increment it by 1 and store that value to another variable.
$statement = DB::select('select work_order_no from work_order where id = 1');
//$won = $won_id->work_order_no+1;
$nextId = intval($statement[0])+1;
$won = $nextId;
It display error - Object of class stdClass could not be converted to int
intval($statement[0]->work_order_no)+1;.