From cb0780898e35a4e3c6616db5b1f3cb3833518b77 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 19 May 2018 20:59:59 -0600 Subject: [PATCH] Add url() method to Media model --- app/Media.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Media.php b/app/Media.php index 9cb3d19da..8cc2ffd1e 100644 --- a/app/Media.php +++ b/app/Media.php @@ -3,8 +3,14 @@ namespace App; use Illuminate\Database\Eloquent\Model; +use Storage; class Media extends Model { - // + public function url() + { + $path = $this->media_path; + $url = Storage::url($path); + return url($url); + } }