/** * Get Uploads * * The Uploads related to this Model. * @return Illuminate\Support\Collection */ public function getUploads() { return Cache::tags($this->getTags('uploads'))->remember($this->getCacheId('uploads'), self::CACHE_LONG, function () { $uploads = $this->uploads()->get(); if ($uploads->count()) { $uploads = $uploads->map(function ($upload) { return Upload::make($upload); }); } return $uploads; }); }