novius/laravel-nova-field-preview

A Laravel Nova field for open front preview
9,870 1
Install
composer require novius/laravel-nova-field-preview
Latest Version:2.1.1
PHP:>=8.2
License:AGPL-3.0-or-later
Last Updated:May 12, 2026
Links: GitHub  ·  Packagist
Maintainer: novius

Laravel Nova Field Preview

License: AGPL v3

Introduction

This package allows you to add Laravel Nova field to open the front preview url of a ressource.

Requirements

  • Laravel Nova >= 4.0
  • Laravel >= 10.0
  • Laravel >= 8.2

NOTE: These instructions are for Laravel >= 10.0 and PHP >= 8.2 If you are using prior version, please see the previous version's docs.

Installation

You can install the package via composer:

composer require novius/laravel-nova-field-preview

Add OpenPreview field on your Nova Resource.

If the resource have a previewUrl method :

use Laravel\Nova\Resource;
use Novius\LaravelNovaFieldPreview\Nova\Fields\OpenPreview;

class Post extends Resource
{
    protected function fields(): array
    {
        return [
            OpenPreview::make('Preview link'),

Otherwise you must specify the preview url :

use Laravel\Nova\Resource;
use Novius\LaravelNovaFieldPreview\Nova\Fields\OpenPreview;

class Post extends Resource
{
    protected function fields(): array
    {
        return [
            OpenPreview::make('Preview link')
            ->previewUrl(function() {
                // Return here the preview url of the resource
                return $this->resource->url().'.?preview=1';
            }),

Lang files

If you want to customize the lang files, you can publish them with:

php artisan vendor:publish --provider="Novius\LaravelNovaFieldPreview\LaravelNovaFieldPreviewServiceProvider" --tag="lang"

Lint

Lint your code with Laravel Pint using:

composer run-script lint

Licence

This package is under GNU Affero General Public License v3 or (at your option) any later version.

Related Packages

novius/laravel-filament-action-preview

A Laravel Filament action for open front preview

1,213 2
propay/link-preview

Link preview generation for PHP with Laravel support

7,086 1
dusterio/link-preview

Link preview generation for PHP with Laravel support

339,489 127
inspheric/nova-url-field

A Laravel Nova url field.

1,346,179 102
juniora/link-preview

Link preview generation for PHP with Laravel support

1,428 0

Version History

Version Released PHP Laravel License
2.1.1 >=8.2 ^10.0 | ^11.0 | ^12.0 | ^13.0 AGPL-3.0-or-later
2.1.0 >=8.2 ^10.0|^11.0|^12.0 AGPL-3.0-or-later
2.0.1 >=8.2 ^10.0|^11.0 AGPL-3.0-or-later
2.0.0 >=8.2 ^10.0|^11.0 AGPL-3.0-or-later
1.0.0 ^8.1 ^8.83.4|^9.3.1|^10.0 AGPL-3.0-or-later