1
0
Fork 0

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
1 changed files with 4 additions and 2 deletions

View File

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