HasFiles
trait HasFiles (View source)
Methods
                    MorphToMany
                
                
                    files()
        
                                            
                
            Defines the many-to-many relationship for file objects.
                    string|null
                
                
                
            
                    array
                
                
                    filesList(string $role, string|null $locale = null)
        
                                            
                
            Returns an array of URLs of all attached files for a role.
                    File|null
                
                
                    fileObject(string $role, string|null $locale = null)
        
                                            
                
            Returns the file object attached for a role.
Details
        
                            MorphToMany
    files()
        
    
    Defines the many-to-many relationship for file objects.
        
                            string|null
    file(string $role, string|null $locale = null, File|null $file = null)
        
    
    Returns the URL of the attached file for a role.
        
                            array
    filesList(string $role, string|null $locale = null)
        
    
    Returns an array of URLs of all attached files for a role.
        
                            File|null
    fileObject(string $role, string|null $locale = null)
        
    
    Returns the file object attached for a role.