Add url() method to Media model

This commit is contained in:
Daniel Supernault 2018-05-19 20:59:59 -06:00
parent 05df1c6a5f
commit cb0780898e

View file

@ -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);
}
} }