At this point, it's not possible to do that in Nova. If you want this kind of functionality you have to build it yourself. You can easily create your own File component for this ;)
Viewing Files in Nova instead of downloading them
I'm currently using Nova in a project where I want to be able to view a file (PDF) in the browser instead of the default download link when I'm viewing the resource. If I use the preview function it says "This image could not be found." but it has a link to view the file (which opens in a new tab).
Is there a way to make the default behaviour when viewing the resource be a simple "View in browser" link?
Here's the current code that gets the "This image could not be found." But the words "This image" is a hyperlink that has the desired URL I want that opens the file in a new browser window.
File::make('File')
->preview(function ($value, $disk) {
return Storage::disk($disk)->url($value);
}),
Please or to participate in this conversation.