PHPackages                             shuvroroy/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. [Admin Panels](/categories/admin)
4. /
5. shuvroroy/nova-dynamic-views

ActiveLibrary[Admin Panels](/categories/admin)

shuvroroy/nova-dynamic-views
============================

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

v2.2.11(6mo ago)1025.7k↓21.4%4MITJavaScriptPHP ^8.1

Since Apr 30Pushed 6mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (29)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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNzU1OTUsIm5iZiI6MTc3NTI3NTI5NSwicGF0aCI6Ii8yMTA2NjQxOC80MDM5OTA0OTUtMjdhMzg5NjctM2RjNC00YjkzLWFmOGQtMGU2YTkwNDg4MmQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA0VDA0MDEzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRlNGM3YTBkN2VkMjYxMmNiMGM0MGJiMzRjZmMyZTlkMDFkZTY5NDMwZTA2MTUzNjM0MGI3NmNjY2U4YTRmNTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.jGRC8JXGsBkmuf0YbuAu6B-IGPszvOwt26n_ye6yDog)](https://private-user-images.githubusercontent.com/21066418/403990495-27a38967-3dc4-4b93-af8d-0e6a904882d2.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNzU1OTUsIm5iZiI6MTc3NTI3NTI5NSwicGF0aCI6Ii8yMTA2NjQxOC80MDM5OTA0OTUtMjdhMzg5NjctM2RjNC00YjkzLWFmOGQtMGU2YTkwNDg4MmQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA0VDA0MDEzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRlNGM3YTBkN2VkMjYxMmNiMGM0MGJiMzRjZmMyZTlkMDFkZTY5NDMwZTA2MTUzNjM0MGI3NmNjY2U4YTRmNTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.jGRC8JXGsBkmuf0YbuAu6B-IGPszvOwt26n_ye6yDog)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

48

—

FairBetter than 95% of packages

Maintenance66

Regular maintenance activity

Popularity36

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 98.4% 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

Every ~34 days

Recently: every ~54 days

Total

28

Last Release

198d ago

Major Versions

v1.3.0 → v2.0.02024-12-25

v1.4.0 → v2.2.12025-01-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba5307dd9bf29fdf264ba852cbc61be18acfaa17279090b1a0c18b4c38a4affa?d=identicon)[shuvroroy](/maintainers/shuvroroy)

---

Top Contributors

[![shuvroroy](https://avatars.githubusercontent.com/u/21066418?v=4)](https://github.com/shuvroroy "shuvroroy (60 commits)")[![258034-DuongVietHoang](https://avatars.githubusercontent.com/u/183567586?v=4)](https://github.com/258034-DuongVietHoang "258034-DuongVietHoang (1 commits)")

---

Tags

laravelnova

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[khalin/nova-link-field

A Laravel Nova Link field.

31562.2k2](/packages/khalin-nova-link-field)[digital-creative/nova-dashboard

The missing dashboard for nova.

7169.3k1](/packages/digital-creative-nova-dashboard)[harrald/nova-combobox-filter

A Laravel Nova combobox filter. Supports selecting multiple items

13105.5k](/packages/harrald-nova-combobox-filter)[marianvlad/nova-ssl-card

A Laravel Nova card for SSL certificates.

1219.9k](/packages/marianvlad-nova-ssl-card)

PHPackages © 2026

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