PHPackages                             formfeed-uk/nova-breadcrumbs - 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. formfeed-uk/nova-breadcrumbs

ActiveLibrary

formfeed-uk/nova-breadcrumbs
============================

A Laravel Nova package to extend the capabilities of the first party Nova Breadcrumbs

3.1.2(3y ago)19172.1k—1%16[4 PRs](https://github.com/Formfeed-UK/nova-breadcrumbs/pulls)MITPHPPHP ^7.4|^8

Since Jun 1Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Formfeed-UK/nova-breadcrumbs)[ Packagist](https://packagist.org/packages/formfeed-uk/nova-breadcrumbs)[ Docs](https://github.com/formfeed-uk/nova-breadcrumbs)[ RSS](/packages/formfeed-uk-nova-breadcrumbs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (28)Used By (0)

Nova 4 Breadcrumbs
==================

[](#nova-4-breadcrumbs)

This [Laravel Nova](https://nova.laravel.com/) package extends the breadcrumbs functionality of the First Party Nova breadcrumbs.

Tests repo can be found here:

Version 2.x Changes
-------------------

[](#version-2x-changes)

Version 2.x is a significant change from previous versions, this package now augments the existing nova breadcrumbs to offer:

- Static methods on the breadcrumbs class allowing control of breadcrumb generation globally
- Methods on Resources allowing control of breadcrumb generation per resource (per-resource methods override static callbacks)
- Support for resource groups
- Nested resource breadcrumbs

#### Breaking changes from 1.x

[](#breaking-changes-from-1x)

- Will use the Nova 4.19+ Breadcrumbs Vue components
- No Longer uses resource cards (This gives better UX as the breadcrumbs will be sent via the page props as per the built in ones and drops a request)
- Will intercept the Nova Breadcrumbs via middleware
- Can no longer have custom CSS (due to using the Nova components)
- Can no longer use the onlyOn{view}, exceptOn{view} etc permissions methods. Breadcrumb visibility can now be controlled via the callbacks/class methods
- Each breadcrumb will extend the Nova Breadcrumb class, and the array of Breadcrumbs will extend the Nova Breadcrumbs class.

Requirements &gt;= v2.x
-----------------------

[](#requirements--v2x)

- `php: >=8.0`
- `laravel/nova: ^4.19`

Requirements &lt;= v1.x
-----------------------

[](#requirements--v1x)

- `php: >=8.0`
- `laravel/nova: ^4.0`
- `formfeed-uk/nova-resource-cards: ^1.1`

Features
--------

[](#features)

This package adds automated breadcrumbs to the top of Nova 4 resources.

It supports:

- belongsTo relationships to build a full set of breadcrumbs to your Nova root.
- Automatic detection of belongsTo relationships, and the ability to specify a relationship as the "parent" relationship
- Linking directly to Resource Tabs in the [eminiarts/nova-tabs](https://github.com/eminiarts/nova-tabs) package (Tab slugs are recommended)
- Linking to either the resource's index or its parent (for relationships included as fields)
- Customising the title and label functions for resources
- Use on Dashboards (only to the extent that the Breadcrumbs show as `Home -> {Current Dashboard}`). Mainly for UI consistency.
- Methods/Callbacks to control the breadcrumbs generation global or per resource

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

[](#installation)

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

```
composer require formfeed-uk/nova-breadcrumbs
```

2. Publish the config file (optional)

```
php artisan vendor:publish --tag=nova-breadcrumbs-config
```

Usage
-----

[](#usage)

### General

[](#general)

1. Enable Nova Breadcrumbs in the same way as the first party Nova Breadcrumbs in your `NovaServiceProvider` `boot` method:

```
    public function boot() {
        parent::boot();

        Nova::withBreadcrumbs(true);
    }
```

2. Optionally configure a `parent` method on your Model to explicitly define the relationship the package should query. The name of this function can be changed in the configuration file.

```
class MyModel extends Model {

    ...

    public function parent() {
        return $this->config();
    }

    public function config() {
        return $this->belongsTo(Config::class, "config_id");
    }

    ...

}
```

### Resource Methods

[](#resource-methods)

You can optionally override the default behaviour of the breadcrumbs package on a per resource basis by adding methods to your Nova Resource. These methods should all return an instance of Breadcrumb or an array of Breadcrumb instances.

- `groupBreadcrumb(NovaRequest $request, Breadcrumbs $breadcrumbs, Breadcrumb $groupBreadcrumb)` - Override the group breadcrumb for this resource
- `indexBreadcrumb(NovaRequest $request, Breadcrumbs $breadcrumbs, Breadcrumb $indexBreadcrumb)` - Override the index breadcrumb for this resource
- `detailBreadcrumb(NovaRequest $request, Breadcrumbs $breadcrumbs, Breadcrumb $detailBreadcrumb)` - Override the detail breadcrumb for this resource
- `formBreadcrumb(NovaRequest $request, Breadcrumbs $breadcrumbs, Breadcrumb $formBreadcrumb, $type)` - Override the form breadcrumb for this resource, $type is a string referring to the current form type (create, update, attach, replicate etc)
- `resourceBreadcrumbs(NovaRequest $request, Breadcrumbs $breadcrumbs, array $breadcrumbArray)` - Override the entire set of breadcrumbs for this resource

For Dashboards, you can use the following method:

- `dashboardBreadcrumb(NovaRequest $request, Breadcrumbs $breadcrumbs, Breadcrumb $dashboardBreadcrumb)` - Override the dashboard breadcrumb for this resource

#### Example

[](#example)

```
class MyResource extends Resource {

    // Change the name of the breadcrumb
    public function detailBreadcrumb(NovaRequest $request, Breadcrumbs $breadcrumbs, Breadcrumb $detailBreadcrumb) {
        return $detailBreadcrumb->name = _('My Custom Name');
    }

    // Remove all previous breadcrumbs and add a new root
    public function resourceBreadcrumbs(NovaRequest $request, Breadcrumbs $breadcrumbs, array $breadcrumbArray) {
        $breadcrumbs->items = [Breadcrumb::make('Home', '/')];
        return $breadcrumbArray;
    }

    // Prevent the group breadcrumb for this resource
    public function groupBreadcrumb(NovaRequest $request, Breadcrumbs $breadcrumbs, Breadcrumb $groupBreadcrumb) {
        return null;
    }
}
```

### Static Callbacks

[](#static-callbacks)

You can override the default behaviour of the breadcrumbs globally by using the following static methods on the Breadcrumbs class. They should be provided within a boot method on a service provider.

These methods will be overriden by any per resource methods.

The closure provided should return either an instance of Breadcrumb or an array of Breadcrumb instances.

- detailCallback(callable $callback)
- indexCallback(callable $callback)
- formCallback(callable $callback)
- resourceCallback(callable $callback)
- dashboardCallback(callable $callback)
- rootCallback(callable $callback)
- groupCallback(callable $callback)

#### Example

[](#example-1)

```
use FormFeed\Breadcrumbs\Breadcrumb;
use FormFeed\Breadcrumbs\Breadcrumbs;

class NovaServiceProvider extends ServiceProvider {

    public function boot() {
        parent::boot();

        Nova::withBreadcrumbs(true);

        Breadcrumbs::detailCallback(function(NovaRequest $request, Breadcrumbs $breadcrumbs, Breadcrumb $detailBreadcrumb) {
            return $detailBreadcrumb->name = _('My Custom Name');
        });

        Breadcrumbs::rootCallback(function(NovaRequest $request, Breadcrumbs $breadcrumbs, Breadcrumb $rootBreadcrumb) {
            return Breadcrumb::make(_('My Custom Root Breadcrumb'), "/my-root");
        });
    }
}
```

### Configuration Options

[](#configuration-options)

Please see the included config file for a full list of configuration options (it's well commented).

In addition to these options you can also specify the following options in the resource itself:

#### Link To parent

[](#link-to-parent)

This determines if the breadcrumb should link to the parent resource regardless of if the current resource's index is navigable from the main menu:

`public static $linkToParent = true|false;`

#### Disable Parent Breadcrumbs

[](#disable-parent-breadcrumbs)

Resolving Parent breadcrumbs can be disabled by adding the following static variable to a resource:

`public static $resolveParentBreadcrumbs = false;`

#### Invoking Reflection

[](#invoking-reflection)

Determining the parent via invoking reflected blank model methods and checking the returned type is now disabled by default.

It is highly recommended that this functionality be left off, and either a parent method, form field, or a defined relationship return type be used instead.

However if needed you can still enable this functionality by doing the following:

- If downloading for the first time after 1.0.0 is released, set the `invokingReflection` configuration option after publishing the config
- If upgrading from 0.1.x add the following to your config: `"invokingReflection" => true`

You can also set this on a per-resource basis with the following static:

`public static $invokingReflection = true|false;`

Issues/Todo
-----------

[](#issuestodo)

- Enable support for Polymorphic/ManyToMany relationships based upon previously visited resources

If you have any requests for functionality or find any bugs please open an issue or submit a Pull Request. Pull requests will be actioned faster than Issues.

License
-------

[](#license)

Nova Breadcrumbs is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.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 ~14 days

Recently: every ~27 days

Total

24

Last Release

1119d ago

Major Versions

0.1.4 → 1.0.02022-06-06

v1.x-dev → 2.0.02022-12-05

2.0.2 → 3.0.02023-01-03

v2.x-dev → 3.1.02023-03-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/6116a0834c68177c53e80259399de5ad6cbfc8e49e2c945343f1cacf8accd14a?d=identicon)[ianrobertsFF](/maintainers/ianrobertsFF)

---

Top Contributors

[![ianrobertsFF](https://avatars.githubusercontent.com/u/91917328?v=4)](https://github.com/ianrobertsFF "ianrobertsFF (102 commits)")[![bb140856](https://avatars.githubusercontent.com/u/71066181?v=4)](https://github.com/bb140856 "bb140856 (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![puzzledmonkey](https://avatars.githubusercontent.com/u/3913622?v=4)](https://github.com/puzzledmonkey "puzzledmonkey (1 commits)")[![shawnheide](https://avatars.githubusercontent.com/u/7305354?v=4)](https://github.com/shawnheide "shawnheide (1 commits)")[![VGirol](https://avatars.githubusercontent.com/u/18059718?v=4)](https://github.com/VGirol "VGirol (1 commits)")

---

Tags

breadcrumbslaravellaravel-novanovanova-4laravelbreadcrumbsnova

### Embed Badge

![Health badge](/badges/formfeed-uk-nova-breadcrumbs/health.svg)

```
[![Health](https://phpackages.com/badges/formfeed-uk-nova-breadcrumbs/health.svg)](https://phpackages.com/packages/formfeed-uk-nova-breadcrumbs)
```

###  Alternatives

[optimistdigital/nova-sortable

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

2872.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.

2861.8M9](/packages/outl1ne-nova-sortable)[laravel/nova-log-viewer

A Laravel Nova tool for viewing your application logs.

136301.3k1](/packages/laravel-nova-log-viewer)[stepanenko3/nova-command-runner

Laravel Nova tool for running Artisan and bash(shell) commands.

36983.0k](/packages/stepanenko3-nova-command-runner)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[dniccum/nova-documentation

A Laravel Nova tool that allows you to add markdown-based documentation to your administrator's dashboard.

37116.4k](/packages/dniccum-nova-documentation)

PHPackages © 2026

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