classes/Input/ModelValidator.php
public function handleImageRules($model, $rules)
    {

        // If the model is an image, the rules were passed in by NestedModels
        // and are good to go
        if (is_a($model, Image::class)) {
            return $rules;
        }

        // Otherwise, remove any image rules because this is a non-Image and
        // these rules will get applied by NestedModels
        return array_where($rules, function ($val, $key) {
            return !starts_with($key, 'images.');
        });
    }
public function handleImageRules($model, $rules)
    {

        // If the model is an image, the rules were passed in by NestedModels
        // and are good to go
        if (is_a($model, Image::class)) {
            return $rules;
        }

        // Otherwise, remove any image rules because this is a non-Image and
        // these rules will get applied by NestedModels
        return array_where($rules, function ($val, $key) {
            return !starts_with($key, 'images.');
        });
    }
public function handleImageRules ( $ model , $ rules ) { // If the model is an image, the rules were passed in by NestedModels // and are good to go if ( is_a ( $ model , Image :: class ) ) { return $ rules ; } // Otherwise, remove any image rules because this is a non-Image and // these rules will get applied by NestedModels return array_where ( $ rules , function ( $ val , $ key ) { return ! starts_with ( $ key , 'images.' ) ; } ) ; }
Handle the Images feature, which is special because you define the rules
on the parent model.

@param  BaseModel $data
@param  array     $rules A Laravel rules array. If null, will be pulled from model
@return array
Handle the Images feature which is special because you define the rules on the parent model .