classes/Models/Traits/CanSerializeTransform.php
protected function runSerializeTransformsOnModel(Model $model)
    {
        // Loop through all the transform functions
        foreach ($this->serialize_transforms as $transform) {

            // Call the transform and if nothing is retuned, return nothing. This will
            // be used by runSerializeTransformsOnCollection() to filter out models.
            if (!$model = call_user_func($transform, $model)) {
                return;
            }
        }

        // Return the transformed model
        return $model;
    }
protected function runSerializeTransformsOnModel(Model $model)
    {
        // Loop through all the transform functions
        foreach ($this->serialize_transforms as $transform) {

            // Call the transform and if nothing is retuned, return nothing. This will
            // be used by runSerializeTransformsOnCollection() to filter out models.
            if (!$model = call_user_func($transform, $model)) {
                return;
            }
        }

        // Return the transformed model
        return $model;
    }
protected function runSerializeTransformsOnModel ( Model $ model ) { // Loop through all the transform functions foreach ( $ this -> serialize_transforms as $ transform ) { // Call the transform and if nothing is retuned, return nothing. This will // be used by runSerializeTransformsOnCollection() to filter out models. if ( ! $ model = call_user_func ( $ transform , $ model ) ) { return ; } } // Return the transformed model return $ model ; }
Run transforms on a single model

@param  Model      $model
@return Model|void
Run transforms on a single model