driver)->url($pathAfter); if (!File::exists($path)) { if ($pathAfter == 'avatar'){ $path = Storage::disk($this->driver)->url('users/default-avatar.jpg'); }else { $path = Storage::disk($this->driver)->url('items/items-default-image.jpg'); } } $file = File::get($path); $type = File::mimeType($path); $response = Response::make($file, 200); $response->header("Content-Type", $type); return $response; } public function store(UploadedFile $file): string { return Storage::disk($this->driver)->put($this->prefix, $file); } /** * @param array $files from Input::file() * @return array */ public function storeInputFiles(array $files): array { $pathToFiles = []; foreach ($files as $fileBag) { foreach ($fileBag as $file) { $pathToFiles[] = $this->store($file); } } return $pathToFiles; } }