public function jsonSerialize()
    {
        $out = [];
        foreach ($this as $model) {
            if (!is_object($model)) {
                continue;
            }
            if ($model instanceof JsonSerializable) {
                $out[] = $model->jsonSerialize();
            } else {
                $out[] = (object)(array)$model;
            }
        }
        return $out;
    }
public function jsonSerialize()
    {
        $out = [];
        foreach ($this as $model) {
            if (!is_object($model)) {
                continue;
            }
            if ($model instanceof JsonSerializable) {
                $out[] = $model->jsonSerialize();
            } else {
                $out[] = (object)(array)$model;
            }
        }
        return $out;
    }
public function jsonSerialize ( ) { $ out = [ ] ; foreach ( $ this as $ model ) { if ( ! is_object ( $ model ) ) { continue ; } if ( $ model instanceof JsonSerializable ) { $ out [ ] = $ model -> jsonSerialize ( ) ; } else { $ out [ ] = ( object ) ( array ) $ model ; } } return $ out ; }
Export the Collection as a regular PHP array for Json serialization.

@return array The Collection represented as an array.
Export the Collection as a regular PHP array for Json serialization .