class Image extends Model implements Image

This model stores information on an image file in the file system.

Traits

Properties

bool $timestamps Don't maintain timestamps for this model.
protected array $hidden The attributes hidden in the model's JSON form.
protected array $casts The attributes that should be casted to native types.
protected array $dates The attributes that should be mutated to dates.

Methods

setJsonAttr(string $key, mixed $value, string $attrs = 'attrs')

Set a dynamic JSON attribute.

mixed
getJsonAttr(string $key, mixed $default = null, string $attrs = 'attrs')

Get a dynamic JSON attribute.

getUrl()

{@inheritdoc}

BelongsTo
volume()

The volume, this image belongs to.

BelongsTo
annotations()

The annotations on this image.

HasMany
labels()

The labels, this image got attached by the users.

string
getThumbPathAttribute()

Adds the thumbPath attribute to the image model. The path points to the thumbnail image file of this image.

string
getUrlAttribute()

Adds the url attribute to the image model. The url is the absolute path to the original image file.

setMetadataAttribute(array $value)

Set the image metadata attribute.

array
getMetadataAttribute()

Get the image metadata attribute.

Response
getThumb()

Get the thumbnail image as download response.

Response
getFile()

Get the original image as download response.

setWidthAttribute(int $value)

Set the width attribute.

int|null
getWidthAttribute()

Get the width attribute.

setHeightAttribute(int $value)

Set the height attribute.

int|null
getHeightAttribute()

Get the height attribute.

setSizeAttribute(int $value)

Set the size attribute.

int|null
getSizeAttribute()

Get the size attribute.

setMimetypeAttribute(string $value)

Set the mimetype attribute.

string|null
getMimetypeAttribute()

Get the mimetype attribute.

Details

in HasJsonAttributes at line 14
protected setJsonAttr(string $key, mixed $value, string $attrs = 'attrs')

Set a dynamic JSON attribute.

Parameters

string $key Key of the attribute in the JSON.
mixed $value Value of the attribute in the JSON.
string $attrs Name of the JSON column of the model.

in HasJsonAttributes at line 36
protected mixed getJsonAttr(string $key, mixed $default = null, string $attrs = 'attrs')

Get a dynamic JSON attribute.

Parameters

string $key Key of the attribute in the JSON.
mixed $default Default value.
string $attrs Name of the JSON column of the model.

Return Value

mixed

at line 61
getUrl()

{@inheritdoc}

at line 71
BelongsTo volume()

The volume, this image belongs to.

Return Value

BelongsTo

at line 81
BelongsTo annotations()

The annotations on this image.

Return Value

BelongsTo

at line 91
HasMany labels()

The labels, this image got attached by the users.

Return Value

HasMany

at line 102
string getThumbPathAttribute()

Adds the thumbPath attribute to the image model. The path points to the thumbnail image file of this image.

Return Value

string

at line 117
string getUrlAttribute()

Adds the url attribute to the image model. The url is the absolute path to the original image file.

Return Value

string

at line 127
setMetadataAttribute(array $value)

Set the image metadata attribute.

Parameters

array $value

at line 137
array getMetadataAttribute()

Get the image metadata attribute.

Return Value

array

at line 147
Response getThumb()

Get the thumbnail image as download response.

Return Value

Response

at line 161
Response getFile()

Get the original image as download response.

Return Value

Response

at line 206
setWidthAttribute(int $value)

Set the width attribute.

Parameters

int $value

at line 216
int|null getWidthAttribute()

Get the width attribute.

Return Value

int|null

at line 226
setHeightAttribute(int $value)

Set the height attribute.

Parameters

int $value

at line 236
int|null getHeightAttribute()

Get the height attribute.

Return Value

int|null

at line 246
setSizeAttribute(int $value)

Set the size attribute.

Parameters

int $value

at line 256
int|null getSizeAttribute()

Get the size attribute.

Return Value

int|null

at line 266
setMimetypeAttribute(string $value)

Set the mimetype attribute.

Parameters

string $value

at line 276
string|null getMimetypeAttribute()

Get the mimetype attribute.

Return Value

string|null