FileTypeTrait
File type trait
Table of Contents
Methods
- getFileType() : string|false
- Get file type
- getMimeTypeColumnName() : string
- Get default column name
- getMimeTypeColumnValue() : string|null
- Get file mime type value
- isApplication() : bool
- Return true if file is application
- isAudio() : bool
- Return true if file is audio
- isDirectory() : bool
- Return true if file type is directory
- isFileType() : bool
- Return true if file have mime type
- isFont() : bool
- Return true if file is font
- isImage() : bool
- Return true if file is image
- isPdf() : bool
- Return true if file is pdf
- isText() : bool
- Return true if file is text
- isVideo() : bool
- Return true if file is video
- isZip() : bool
- Return true if file type is zip
- scopeFileTypeQuery() : Builder
- File type scope
Methods
getFileType()
Get file type
public
getFileType() : string|false
Return values
string|falsegetMimeTypeColumnName()
Get default column name
public
getMimeTypeColumnName() : string
Return values
stringgetMimeTypeColumnValue()
Get file mime type value
public
getMimeTypeColumnValue() : string|null
Return values
string|nullisApplication()
Return true if file is application
public
isApplication() : bool
Return values
boolisAudio()
Return true if file is audio
public
isAudio() : bool
Return values
boolisDirectory()
Return true if file type is directory
public
isDirectory() : bool
Return values
boolisFileType()
Return true if file have mime type
public
isFileType(string $type) : bool
Parameters
- $type : string
-
one from: image,video,audio,application,text,pdd,font
Return values
boolisFont()
Return true if file is font
public
isFont() : bool
Return values
boolisImage()
Return true if file is image
public
isImage() : bool
Return values
boolisPdf()
Return true if file is pdf
public
isPdf() : bool
Return values
boolisText()
Return true if file is text
public
isText() : bool
Return values
boolisVideo()
Return true if file is video
public
isVideo() : bool
Return values
boolisZip()
Return true if file type is zip
public
isZip() : bool
Return values
boolscopeFileTypeQuery()
File type scope
public
scopeFileTypeQuery(Builder $query, string $type) : Builder
Parameters
- $query : Builder
- $type : string