caddydz/nova-preview-resource

Preview a Laravel Nova resource via a popup on the index view

1.0.0 2023-02-19 03:34 UTC

This package is auto-updated.

Last update: 2024-12-19 16:40:34 UTC


README

Install the package

composer require caddydz/nova-preview-resource

For Laravel Nova 3 and below

composer require caddydz/nova-preview-resource:0.0.2

Use the field on any resource

use Caddydz\NovaPreviewResource\NovaPreviewResource;

NovaPreviewResource::make(__('Preview'))
	->image($this->avatar) // Optional
	->width(150) // Optional (in pixels)
	->options([
		__('Key') => $this->value,
		__('Foo') => $this->bar,
		__('Bar') => $this->baz,
	])
	->noValueText('No options available'), // Optional