PHPackages                             pdewringerswis/nova-dynamic-views - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. pdewringerswis/nova-dynamic-views

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pdewringerswis/nova-dynamic-views
=================================

A tool for easier overwriting custom-header and toolbars in Laravel Nova

2.3(2mo ago)039MITPHP ^8.1

Since May 12Compare

[ Source](https://github.com/pimdewringerSwis/nova-dynamic-views)[ Packagist](https://packagist.org/packages/pdewringerswis/nova-dynamic-views)[ Fund](https://www.buymeacoffee.com/shuvroroy)[ RSS](/packages/pdewringerswis-nova-dynamic-views/feed)WikiDiscussions Synced 3w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Nova dynamic views
==================

[](#nova-dynamic-views)

[![PHP Version Require](https://camo.githubusercontent.com/e92904ec30f2c2aab1c83a7c7c2e40835a9d698d4c3652e42f85ddc58b03338c/68747470733a2f2f706f7365722e707567782e6f72672f73687576726f726f792f6e6f76612d64796e616d69632d76696577732f726571756972652f706870)](https://packagist.org/packages/shuvroroy/nova-dynamic-views)[![Latest Stable Version](https://camo.githubusercontent.com/8b39d601f580f8c6c6f9c7d602974f4704e899235c4b6a1d5914d1291b092d05/68747470733a2f2f706f7365722e707567782e6f72672f73687576726f726f792f6e6f76612d64796e616d69632d76696577732f76)](https://packagist.org/packages/shuvroroy/nova-dynamic-views)[![Total Downloads](https://camo.githubusercontent.com/a15c265739c96eaf2d9e9241b7fb2f6ae396747cbb473860b7e8e7fb7ddbe1f8/68747470733a2f2f706f7365722e707567782e6f72672f73687576726f726f792f6e6f76612d64796e616d69632d76696577732f646f776e6c6f616473)](https://packagist.org/packages/shuvroroy/nova-dynamic-views)[![License](https://camo.githubusercontent.com/883b8115a551cd95726ff43f2b7d05bd7bd956b72c21c47a941668d48b6590df/68747470733a2f2f706f7365722e707567782e6f72672f73687576726f726f792f6e6f76612d64796e616d69632d76696577732f6c6963656e7365)](https://packagist.org/packages/shuvroroy/nova-dynamic-views)

This package will help to add some custom placeholder components like `custom-index-header`, `custom-index-toolbar`, `custom-detail-header`, `custom-detail-toolbar`, etc in various section in views. It provides a much easier API for it and it allows you to use these "placeholder" components multiple times without overwriting each other.

[![Screenshot 2025-01-17 at 12 04 08 AM](https://private-user-images.githubusercontent.com/21066418/403990495-27a38967-3dc4-4b93-af8d-0e6a904882d2.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODIzOTM3NzQsIm5iZiI6MTc4MjM5MzQ3NCwicGF0aCI6Ii8yMTA2NjQxOC80MDM5OTA0OTUtMjdhMzg5NjctM2RjNC00YjkzLWFmOGQtMGU2YTkwNDg4MmQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA2MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNjI1VDEzMTc1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU0ZTFiOWY5MjEyYTJmODI4NzU3Mjk1ZjhjMmMwNWNjOTA0ODNiM2E4MjQyODk4NDZkMWY4OWE1OGQ1YmY4YmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.pMqe-i0uubWifIT4BCuTzbG24yuzpgyeS4nzXaT4KfE)](https://private-user-images.githubusercontent.com/21066418/403990495-27a38967-3dc4-4b93-af8d-0e6a904882d2.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODIzOTM3NzQsIm5iZiI6MTc4MjM5MzQ3NCwicGF0aCI6Ii8yMTA2NjQxOC80MDM5OTA0OTUtMjdhMzg5NjctM2RjNC00YjkzLWFmOGQtMGU2YTkwNDg4MmQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA2MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNjI1VDEzMTc1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU0ZTFiOWY5MjEyYTJmODI4NzU3Mjk1ZjhjMmMwNWNjOTA0ODNiM2E4MjQyODk4NDZkMWY4OWE1OGQ1YmY4YmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.pMqe-i0uubWifIT4BCuTzbG24yuzpgyeS4nzXaT4KfE)Requirements
------------

[](#requirements)

- PHP (^8.1 or higher)
- Laravel Nova (^5.0 or higher)

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

[](#installation)

Require the package with composer

```
composer require shuvroroy/nova-dynamic-views

```

Register the tool in the `tools` method in `\App\Providers\NovaServiceProvider`:

```
use ShuvroRoy\NovaDynamicViews\NovaDynamicViews;

...

public function tools(): array
{
    return [
        new NovaDynamicViews(),
    ];
}
```

Usage
-----

[](#usage)

Let's say you want to add a custom button to the `toolbar` of all `index` views. Just create a vue component for it, as you would do if you use the `custom-index-header` (see section "Create custom component" if you don't know how to). Let's call it `my-index-toolbar-btn`. Now the only thing you have to do is register it to your `\App\Ņova\Resource` class, within a new method called `customIndexToolbarComponents`, which returns a `\ShuvroRoy\NovaDynamicViews\CustomComponents` object:

```
public function customIndexToolbarComponents(): CustomComponents
{
    return CustomComponents::make()
       ->addItem('my-index-toolbar-btn');
}
```

Thats it. Now you should see the content of your component in the toolbar.

### Provide extra data

[](#provide-extra-data)

If you want to add extra data (for example a label) to your component (without extra request), just add it to the `addItem` method as second parameter (as array):

```
public function customIndexToolbarComponents(): CustomComponents
{
    return CustomComponents::make()
       ->addItem('my-index-toolbar-btn', [
           'label' => 'My label'
       ]);
}
```

### Access resource data

[](#access-resource-data)

You have access to the ressource class in all methods by using `$this`. On `detail` and `edit` components, you have access to the ID of the current model with `request('id')`. So if you need the model itself in your `customDetailHeaderComponents`, `customDetailToolbarComponents` or your `customUpdateHeaderComponents`, you can query for it like so:

```
public function customDetailToolbarComponents(): CustomComponents
{
    $model = $this->model()->query()->where('id', request('id'))->first();

    //...
}
```

### Add (tailwind) class to the container

[](#add-tailwind-class-to-the-container)

If you want to add additional CSS classes to the container div of a section (for example add `flex w-full justify-end items-center mx-3` to the `customIndexToolbarComponents` section), add the `class` in the `make` function (or use the `setClass` method):

```
public function customIndexToolbarComponents(): CustomComponents
{
    return CustomComponents::make('flex w-full justify-end items-center mx-3')
       ->addItem('my-index-toolbar-btn');
}
```

### Full usage example

[](#full-usage-example)

```
use ShuvroRoy\NovaDynamicViews\CustomComponents;

class Resource extends \Laravel\Nova\Resource
{
    ...

    /**
     * Using the `custom-index-toolbar` placeholder component
     *
     * @return CustomComponents
     */
    public function customIndexToolbarComponents(): CustomComponents
    {
        return CustomComponents::make('flex w-full justify-end items-center mx-3')
            ->addItem('my-index-toolbar-btn', [
                'title' => 'My first btn'
            ])
            ->addItem('my-index-toolbar-btn', [
                'title' => 'My second btn'
            ]);
    }

    /**
     * Using the `custom-detail-header` placeholder component
     *
     * @return CustomComponents
     */
    public function customDetailHeaderComponents(): CustomComponents
    {
        $model = $this->model()->query()->where('id', request('id'))->first();

        return CustomComponents::make()
           ->addItem('my-other-component', [
                'id' => $model->id,
                'name' => $model->name
           ]);
    }
}
```

### Use only on specific resources

[](#use-only-on-specific-resources)

If you want to show this button only on a specific resource, for example only for Users, just add this method to the `\App\Nova\User` class.

Available methods and areas
---------------------------

[](#available-methods-and-areas)

All `custom-*-*` nova placeholders are available as camel case methods postfixed with `Components`:

- ✅ `customIndexHeaderComponents`
- ✅ `customIndexToolbarComponents`
- ✅ `customDetailHeaderComponents`
- ✅ `customDetailToolbarComponents`
- ✅ `customCreateHeaderComponents`
- ✅ `customAttachHeaderComponents`
- ✅ `customUpdateAttachHeaderComponents`
- ✅ `customUpdateHeaderComponents`
- ✅ `customLensHeaderComponents`
- ✅ `customLensToolbarComponents`

Create custom component
-----------------------

[](#create-custom-component)

This is just a kick start documentation for this. For more info, see

Create a new resource tool with artisan:

```
php artisan nova:resource-tool acme/my-index-toolbar-btn
```

and say yes to all questions of the prompt. Now you can use this component (located ad `nova-components/my-index-toolbar-btn`) inside your `customXXXComponents` (f.e. `customIndexToolbarComponents`)

Credits
-------

[](#credits)

- [Shuvro Roy](https://github.com/shuvroroy)
- [Bernhard Hörmann](https://github.com/bernhardh)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance86

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

73d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/198086411?v=4)[pimdewringerSwis](/maintainers/pimdewringerSwis)[@pimdewringerSwis](https://github.com/pimdewringerSwis)

---

Tags

laravelnova

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/pdewringerswis-nova-dynamic-views/health.svg)

```
[![Health](https://phpackages.com/badges/pdewringerswis-nova-dynamic-views/health.svg)](https://phpackages.com/packages/pdewringerswis-nova-dynamic-views)
```

###  Alternatives

[ebess/advanced-nova-media-library

Laravel Nova tools for managing the Spatie media library.

6163.5M22](/packages/ebess-advanced-nova-media-library)[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2852.1M6](/packages/optimistdigital-nova-sortable)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2862.1M9](/packages/outl1ne-nova-sortable)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[advoor/nova-editor-js

A Laravel Nova field bringing EditorJs magic to Nova.

92219.3k3](/packages/advoor-nova-editor-js)[outl1ne/nova-page-manager

Page(s) and region(s) manager for Laravel Nova.

17947.0k](/packages/outl1ne-nova-page-manager)

PHPackages © 2026

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