Skip to content

Commit e214350

Browse files
Update File.php
1 parent dbdbe44 commit e214350

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/File.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,26 @@ public function file()
2828
{
2929
return $this->belongsTo(Upload::class, 'upload_id');
3030
}
31+
32+
/**
33+
* Get Url Directly
34+
*
35+
* @return string
36+
*/
37+
public function getUrlAttribute()
38+
{
39+
return $this->file->url;
40+
}
41+
42+
/**
43+
* Get Thumbnail
44+
*
45+
* @return string
46+
*/
47+
public function getThumbnailAttribute()
48+
{
49+
return $this->file->thumbnail ?? null;
50+
}
3151

3252
/**
3353
* Get the owning model.

0 commit comments

Comments
 (0)