1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-25 17:26:43 +00:00
pixelfed/app/Media.php
Daniel Supernault 4e51fbd5eb Add soft-deletes
2018-06-13 18:52:42 -06:00

26 lines
444 B
PHP

<?php
namespace App;
use Storage;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Media extends Model
{
use SoftDeletes;
/**
* The attributes that should be mutated to dates.
*
* @var array
*/
protected $dates = ['deleted_at'];
public function url()
{
$path = $this->media_path;
$url = Storage::url($path);
return url($url);
}
}