StorageFile
extends Model
in package
implements
Entity, TempFileModel
Uses
HasEntity, HasFactory, HasItemMorph, HasUserMorph
Class File.
Table of Contents
Interfaces
- Entity
- Interface Entity.
- TempFileModel
- Interface TempFileModel.
Constants
- ENTITY_TYPE = 'storage_file'
Properties
- $created_at : string
- $extension : string
- $file_size : string
- $height : int
- $id : int
- $images : array<string|int, mixed>
- $is_image : bool
- $is_origin : int
- $item_id : string
- $item_type : string
- $mime_type : string
- $origin_id : int
- $original_name : string
- $path : string
- $storage_id : int
- $target : string
- $updated_at : string
- $url : string
- $user_id : string
- $user_type : string
- $variant : string
- $width : int
- $fillable : array<string|int, string>
- $table : mixed
Methods
- attach() : void
- entityId() : int
- entityType() : string
- factory() : FileFactory
- getFileNameAttribute() : string
- getImageAttribute() : string|null
- getImagesAttribute() : array<string|int, mixed>
- getImagesAttributes() : array<string|int, mixed>|null
- getIsImageAttribute() : bool
- getIsOriginAttribute() : bool
- getItemAttribute() : mixed
- getServerIdAttribute() : string
- getUrlAttribute() : string
- getUserAttribute() : mixed
- getUserEntityAttribute() : mixed
- isOrigin() : bool
- isUser() : bool
- check if $user is the user (creator) of entity.
- item() : MorphTo|null
- itemId() : int
- itemType() : string
- moduleName() : string
- rollDown() : mixed
- rollUp() : void
- transfer() : void
- user() : MorphTo
- userEntity() : BelongsTo
- userId() : int
- userType() : string
- booted() : mixed
- newFactory() : FileFactory
Constants
ENTITY_TYPE
public
mixed
ENTITY_TYPE
= 'storage_file'
Properties
$created_at
public
string
$created_at
$extension
public
string
$extension
$file_size
public
string
$file_size
$height
public
int
$height
$id
public
int
$id
$images
public
array<string|int, mixed>
$images
$is_image
public
bool
$is_image
$is_origin
public
int
$is_origin
$item_id
public
string
$item_id
$item_type
public
string
$item_type
$mime_type
public
string
$mime_type
$origin_id
public
int
$origin_id
$original_name
public
string
$original_name
$path
public
string
$path
$storage_id
public
int
$storage_id
$target
public
string
$target
$updated_at
public
string
$updated_at
$url
public
string
$url
$user_id
public
string
$user_id
$user_type
public
string
$user_type
$variant
public
string
$variant
$width
public
int
$width
$fillable
protected
array<string|int, string>
$fillable
= ['storage_id', 'target', 'origin_id', 'is_origin', 'variant', 'user_id', 'user_type', 'item_type', 'item_id', 'original_name', 'file_size', 'path', 'mime_type', 'extension', 'width', 'height', 'created_at', 'updated_at']
$table
protected
mixed
$table
= 'storage_files'
Methods
attach()
public
attach(string $storage) : void
Parameters
- $storage : string
entityId()
public
entityId() : int
Return values
intentityType()
public
entityType() : string
Return values
stringfactory()
public
static factory(mixed $parameters) : FileFactory
Parameters
- $parameters : mixed
Return values
FileFactorygetFileNameAttribute()
public
getFileNameAttribute() : string
Return values
stringgetImageAttribute()
public
getImageAttribute() : string|null
Return values
string|nullgetImagesAttribute()
public
getImagesAttribute() : array<string|int, mixed>
Return values
array<string|int, mixed>getImagesAttributes()
public
getImagesAttributes() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetIsImageAttribute()
public
getIsImageAttribute() : bool
Return values
boolgetIsOriginAttribute()
public
getIsOriginAttribute() : bool
Return values
boolgetItemAttribute()
public
getItemAttribute() : mixed
getServerIdAttribute()
public
getServerIdAttribute() : string
Return values
stringgetUrlAttribute()
public
getUrlAttribute() : string
Return values
stringgetUserAttribute()
public
getUserAttribute() : mixed
getUserEntityAttribute()
public
getUserEntityAttribute() : mixed
isOrigin()
public
isOrigin() : bool
Return values
boolisUser()
check if $user is the user (creator) of entity.
public
isUser(User $user) : bool
Parameters
- $user : User
Return values
boolitem()
public
item() : MorphTo|null
Return values
MorphTo|nullitemId()
public
itemId() : int
Return values
intitemType()
public
itemType() : string
Return values
stringmoduleName()
public
moduleName() : string
Return values
stringrollDown()
public
rollDown() : mixed
rollUp()
public
rollUp() : void
transfer()
public
transfer(mixed $source, mixed $target, bool $trash) : void
Parameters
- $source : mixed
- $target : mixed
- $trash : bool
user()
public
user() : MorphTo
Return values
MorphTouserEntity()
public
userEntity() : BelongsTo
Return values
BelongsTouserId()
public
userId() : int
Return values
intuserType()
public
userType() : string
Return values
stringbooted()
protected
static booted() : mixed
newFactory()
protected
static newFactory() : FileFactory