PHPackages                             lupennat/preview - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. lupennat/preview

AbandonedArchivedLibrary

lupennat/preview
================

Laravel Nova - Preview Field

v1.0.0(2y ago)013MITPHPPHP ^7.4|^8.0

Since May 22Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Lupennat/preview)[ Packagist](https://packagist.org/packages/lupennat/preview)[ RSS](/packages/lupennat-preview/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

1. [Requirements](#Requirements)
2. [Installation](#Installation)
3. [Usage](#Usage)
    1. [When Method](#when-method)
    2. [Is Method](#is-method)

Requirements
------------

[](#requirements)

- `php: ^7.4 | ^8`
- `laravel/nova: ^4`

Installation
------------

[](#installation)

You can install the package in to a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require lupennat/preview
```

Usage
-----

[](#usage)

Preview Field can be used to Display a Detail Field on Index Page in a dropdown (like Nova BooleanGroup Field Behaviour). On Detail Page, the field will be always displayed as native field, on Form pages the Field will not be displayed.

### When Method

[](#when-method)

You can use `when` method to switch between preview/inline mode at specific condition.
If a string will be returned from callback, the string will be used as text for the dropdown button.

```
use Illuminate\Support\Str;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
use Lupennat\Preview\Preview;

class Post extends Resource
{

    public function fields(Request $request)
    {
        return [
            Preview::make(__('Title'), 'title')->when(
                fn($value, $resource, $attribute) => strlen($value) > 20 ? Str::limit($value, 20) : false,
                Text::make(__('Title'), 'title')
            )
        ];
    }
}
```

### Is Method

[](#is-method)

You can use `is` method to always display a field as preview.

```
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
use Lupennat\Preview\Preview;

class Post extends Resource
{

    public function fields(Request $request)
    {
        return [
            Preview::make(__('Description'), 'description')
                ->is(Text::make(__('Description'), 'description'))
                ->withPreviewLabel(__('View Description'))
        ];
    }
}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1085d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3cea30d9041841dbfc768dc8b690c0cf4fb3244073f9edaf08f9c8f9d04f470a?d=identicon)[lupennat](/maintainers/lupennat)

---

Top Contributors

[![Lupennat](https://avatars.githubusercontent.com/u/6160171?v=4)](https://github.com/Lupennat "Lupennat (3 commits)")

---

Tags

laravelnova

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/lupennat-preview/health.svg)

```
[![Health](https://phpackages.com/badges/lupennat-preview/health.svg)](https://phpackages.com/packages/lupennat-preview)
```

###  Alternatives

[eminiarts/nova-tabs

Laravel Nova - Tabs.

4624.1M20](/packages/eminiarts-nova-tabs)[oneduo/nova-file-manager

A handy file manager tool for Laravel Nova

157350.3k2](/packages/oneduo-nova-file-manager)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[bbs-lab/nova-file-manager

A handy file manager tool for Laravel Nova

1578.0k](/packages/bbs-lab-nova-file-manager)[digital-creative/icon-action-toolbar

Allows you to update a single column of a resource all at once.

2626.0k](/packages/digital-creative-icon-action-toolbar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
