classes/Models/Traits/CanSerializeTransform.php
public function runSerializeTransforms()
    {
        // If the class using this trait is a collection, replace the items in the
        // collection with the transformed set
        if (is_a($this, Collection::class)) {
            $this->items = $this->runSerializeTransformsOnCollection($this);

        // Otherwise, if the class is a model, act directly on it
        } elseif (is_a($this, Model::class)) {
            $this->runSerializeTransformsOnModel($this);
        }
    }
public function runSerializeTransforms()
    {
        // If the class using this trait is a collection, replace the items in the
        // collection with the transformed set
        if (is_a($this, Collection::class)) {
            $this->items = $this->runSerializeTransformsOnCollection($this);

        // Otherwise, if the class is a model, act directly on it
        } elseif (is_a($this, Model::class)) {
            $this->runSerializeTransformsOnModel($this);
        }
    }
public function runSerializeTransforms ( ) { // If the class using this trait is a collection, replace the items in the // collection with the transformed set if ( is_a ( $ this , Collection :: class ) ) { $ this -> items = $ this -> runSerializeTransformsOnCollection ( $ this ) ; // Otherwise, if the class is a model, act directly on it } elseif ( is_a ( $ this , Model :: class ) ) { $ this -> runSerializeTransformsOnModel ( $ this ) ; } }
Apply all registered transforms to the items in the collection. If a
transform returns falsey, that model will be removed from the collection

@return void
Apply all registered transforms to the items in the collection . If a transform returns falsey that model will be removed from the collection