From 81944320730022820cbb0ce297323c7535a2b35d Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 5 Jun 2018 19:54:48 -0600 Subject: [PATCH] Update Status model, add cache busting to unprocessed media urls --- app/Status.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Status.php b/app/Status.php index e5e1a59b9..68e65410a 100644 --- a/app/Status.php +++ b/app/Status.php @@ -42,8 +42,10 @@ class Status extends Model public function mediaUrl() { - $path = $this->firstMedia()->media_path; - $url = Storage::url($path); + $media = $this->firstMedia(); + $path = $media->media_path; + $hash = is_null($media->processed_at) ? md5('unprocessed') : md5($media->created_at); + $url = Storage::url($path) . "?v={$hash}"; return url($url); }