Skip to content

Commit

Permalink
Update File.php
Browse files Browse the repository at this point in the history
  • Loading branch information
MoamenEltouny committed May 28, 2021
1 parent dbdbe44 commit e214350
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/File.php
Expand Up @@ -28,6 +28,26 @@ public function file()
{
return $this->belongsTo(Upload::class, 'upload_id');
}

/**
* Get Url Directly
*
* @return string
*/
public function getUrlAttribute()
{
return $this->file->url;
}

/**
* Get Thumbnail
*
* @return string
*/
public function getThumbnailAttribute()
{
return $this->file->thumbnail ?? null;
}

/**
* Get the owning model.
Expand Down

0 comments on commit e214350

Please sign in to comment.