downloadsAreEnabled = false; return $this; } /** * Specify the callback that should be used to create a download HTTP response. * * @param callable(\Laravel\Nova\Http\Requests\NovaRequest, \Laravel\Nova\Resource, ?string, ?string):mixed $downloadResponseCallback * @return $this */ public function download(callable $downloadResponseCallback) { $this->downloadResponseCallback = $downloadResponseCallback; return $this; } /** * Create an HTTP response to download the underlying field. * * @param \Laravel\Nova\Http\Requests\NovaRequest $request * @param \Laravel\Nova\Resource $resource * @return \Illuminate\Http\Response */ public function toDownloadResponse(NovaRequest $request, $resource) { return call_user_func( $this->downloadResponseCallback, $request, $resource->resource, $this->getStorageDisk(), $this->getStoragePath() ); } }