$collection->all(), ]; } /** * Get an array representing the properties of a collection. * * @param SimpleORMap $collection * @return array */ public static function castModel(SimpleORMap $model) { return [ Caster::PREFIX_VIRTUAL . 'attributes' => $model->toArray(), ]; } /** * Get an array representing the properties of a collection. * * @param SimpleCollection $collection * @return array */ public static function castSimpleCollection(SimpleCollection $collection) { return [ Caster::PREFIX_VIRTUAL . 'all' => [...$collection], ]; } }