classes/Models/Base.php
public function getFileAttributesAttribute()
    {

        // Get all the file validation rule keys
        $attributes = array_keys(array_filter(static::$rules, function ($rules) {
            return preg_match('#file|image|mimes|video|dimensions#i', $rules);
        }));

        // Get all the model attributes from upchuck
        if (method_exists($this, 'getUploadMap')) {
            $attributes = array_unique(array_merge($attributes,
                array_values($this->getUploadMap())));
        }

        // Return array of attributes
        return $attributes;
    }
public function getFileAttributesAttribute()
    {

        // Get all the file validation rule keys
        $attributes = array_keys(array_filter(static::$rules, function ($rules) {
            return preg_match('#file|image|mimes|video|dimensions#i', $rules);
        }));

        // Get all the model attributes from upchuck
        if (method_exists($this, 'getUploadMap')) {
            $attributes = array_unique(array_merge($attributes,
                array_values($this->getUploadMap())));
        }

        // Return array of attributes
        return $attributes;
    }
public function getFileAttributesAttribute ( ) { // Get all the file validation rule keys $ attributes = array_keys ( array_filter ( static :: $ rules , function ( $ rules ) { return preg_match ( '#file|image|mimes|video|dimensions#i' , $ rules ) ; } ) ) ; // Get all the model attributes from upchuck if ( method_exists ( $ this , 'getUploadMap' ) ) { $ attributes = array_unique ( array_merge ( $ attributes , array_values ( $ this -> getUploadMap ( ) ) ) ) ; } // Return array of attributes return $ attributes ; }
Get all file fields by looking at Upchuck config and validation rules

@return array The keys of all the attributes that store file references
Get all file fields by looking at Upchuck config and validation rules