mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Add url() method to Media model
This commit is contained in:
parent
05df1c6a5f
commit
cb0780898e
1 changed files with 7 additions and 1 deletions
|
@ -3,8 +3,14 @@
|
||||||
namespace App;
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Storage;
|
||||||
|
|
||||||
class Media extends Model
|
class Media extends Model
|
||||||
{
|
{
|
||||||
//
|
public function url()
|
||||||
|
{
|
||||||
|
$path = $this->media_path;
|
||||||
|
$url = Storage::url($path);
|
||||||
|
return url($url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue