public function getBinaryTexture($type) { if ($this->getTexture($type)) { $hash = $this->getTexture($type); $path = storage_path("textures/{$hash}"); if (Storage::disk('textures')->has($hash)) { // Cache friendly return Response::png(Storage::disk('textures')->get($hash), 200, ['Last-Modified' => $this->getLastModified(), 'Accept-Ranges' => 'bytes', 'Content-Length' => Storage::disk('textures')->size($hash)]); } else { throw new NotFoundHttpException(trans('general.texture-deleted')); } } else { throw new NotFoundHttpException(trans('general.texture-not-uploaded', ['type' => $type])); } }