Update Status model, add cache busting to unprocessed media urls

This commit is contained in:
Daniel Supernault 2018-06-05 19:54:48 -06:00
parent 85d164ce07
commit 8194432073

View file

@ -42,8 +42,10 @@ class Status extends Model
public function mediaUrl() public function mediaUrl()
{ {
$path = $this->firstMedia()->media_path; $media = $this->firstMedia();
$url = Storage::url($path); $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); return url($url);
} }