laravel convert array of objects to array of int code example Example: object to array php $array = (array) $yourObject;