PHPackages                             josespinal/filament-record-navigation - 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. josespinal/filament-record-navigation

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

josespinal/filament-record-navigation
=====================================

Record navigation from views

v2.2.2(1y ago)3142.0k↓41.3%13[2 PRs](https://github.com/josespinal/filament-record-navigation/pulls)2MITPHPPHP ^8.2CI passing

Since May 30Pushed 1y ago2 watchersCompare

[ Source](https://github.com/josespinal/filament-record-navigation)[ Packagist](https://packagist.org/packages/josespinal/filament-record-navigation)[ Docs](https://github.com/josespinal/filament-record-navigation)[ GitHub Sponsors]()[ RSS](/packages/josespinal-filament-record-navigation/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (10)Versions (13)Used By (2)

Filament Record Navigation Plugin
=================================

[](#filament-record-navigation-plugin)

Introduction
------------

[](#introduction)

The **Filament Record Navigation Plugin** allows seamless navigation through records in a Filament resource's view. With this plugin, you can add "Next" and "Previous" buttons to navigate through records efficiently. It includes features like unsaved changes detection, browser history management, and proper URL updates.

    Record.Nav.mp4    Features
--------

[](#features)

- Navigate between records with "Next" and "Previous" buttons
- Unsaved changes detection with confirmation dialog
- Browser history management for proper navigation state
- Seamless URL updates without page refresh
- Automatic relation managers refresh when navigating between records
- Support for Laravel 10, 11, and 12
- Compatible with Filament v3.x

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

[](#installation)

### Step 1: Require the package via Composer:

[](#step-1-require-the-package-via-composer)

```
composer require josespinal/filament-record-navigation
```

The package will automatically register itself.

### Step 2: Publish Filament Assets

[](#step-2-publish-filament-assets)

After installation, you need to publish and build the Filament assets:

```
php artisan filament:assets
```

For production environments, make sure to run:

```
php artisan filament:assets --optimize
```

Usage
-----

[](#usage)

### Use the Trait in Your Filament Resource Page

[](#use-the-trait-in-your-filament-resource-page)

In your Filament resource's `EditRecord` page, use the `HasRecordNavigation` trait to add the navigation functionality. And add the action where you want, for example, the header with `getHeaderActions`:

```
namespace App\Filament\Resources\PostResource\Pages;

use App\Filament\Resources\PostResource;
use Filament\Resources\Pages\EditRecord;
use JoseEspinal\RecordNavigation\Traits\HasRecordNavigation;

class EditPost extends EditRecord
{
    use HasRecordNavigation;

    protected static string $resource = PostResource::class;

    protected function getHeaderActions(): array
    {
        return array_merge(parent::getActions(), $this->getNavigationActions());
    }
}
```

### Use with existing actions

[](#use-with-existing-actions)

If you have existing actions, merge them with the navigation actions, like so:

```
protected function getHeaderActions(): array
{
    $existingActions = [
        // Your existing actions here...
    ];

    return array_merge($existingActions, $this->getNavigationActions());
}
```

### Store Record IDs in Session

[](#store-record-ids-in-session)

In your resource's `ListRecords` page, include the `HasRecordsList` trait as follows:

```
namespace App\Filament\Resources\PostResource\Pages;

use App\Filament\Resources\PostResource;
use Filament\Resources\Pages\ListRecords;
use JoseEspinal\RecordNavigation\Traits\HasRecordsList;

class ListPosts extends ListRecords
{
    use HasRecordsList;

    protected static string $resource = PostResource::class;
}
```

### Enable Relation Managers Refresh

[](#enable-relation-managers-refresh)

To automatically refresh relation managers when navigating between records, use the `HasRelationManagersWithRecordNavigation` trait in your relation managers:

```
namespace App\Filament\Resources\PostResource\RelationManagers;

use Filament\Resources\RelationManagers\RelationManager;
use JoseEspinal\RecordNavigation\Traits\HasRelationManagersWithRecordNavigation;

class CommentsRelationManager extends RelationManager
{
    use HasRelationManagersWithRecordNavigation;

    protected static string $relationship = 'comments';

    // Rest of your relation manager code...
}
```

### Unsaved Changes Detection

[](#unsaved-changes-detection)

The plugin automatically detects unsaved changes in your forms and will prompt for confirmation before navigating away. This helps prevent accidental data loss when navigating between records.

No additional configuration is needed - this feature works out of the box.

#### Customizing the Confirmation Message

[](#customizing-the-confirmation-message)

By default, this uses Filament's translation key `filament-panels::unsaved-changes-alert.body`. You can customize this message by publishing Filament's translations and modifying the corresponding translation string.

Remember to rebuild your assets after making changes.

Browser Support
---------------

[](#browser-support)

The plugin uses modern browser features for enhanced navigation:

- History API for proper browser history management
- URL updates without page refresh
- Works with all modern browsers (Chrome, Firefox, Safari, Edge)

Changelog
---------

[](#changelog)

Please see [CHANGELOG](https://github.com/josespinal/filament-record-navigation/blob/main/CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Jose Espinal](https://github.com/josespinal)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance46

Moderate activity, may be stable

Popularity42

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 96.2% 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 ~40 days

Recently: every ~0 days

Total

9

Last Release

400d ago

Major Versions

v1.0.1 → v2.0.42024-06-05

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10059?v=4)[Jose Espinal](/maintainers/josespinal)[@josespinal](https://github.com/josespinal)

---

Top Contributors

[![josespinal](https://avatars.githubusercontent.com/u/10059?v=4)](https://github.com/josespinal "josespinal (76 commits)")[![UendelC](https://avatars.githubusercontent.com/u/21681869?v=4)](https://github.com/UendelC "UendelC (2 commits)")[![nexassistant](https://avatars.githubusercontent.com/u/119966602?v=4)](https://github.com/nexassistant "nexassistant (1 commits)")

---

Tags

laravelJose Espinalfilament-record-navigation

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/josespinal-filament-record-navigation/health.svg)

```
[![Health](https://phpackages.com/badges/josespinal-filament-record-navigation/health.svg)](https://phpackages.com/packages/josespinal-filament-record-navigation)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[codebar-ag/laravel-filament-json-field

A Laravel Filament JSON Field integration with CodeMirror support

1124.1k](/packages/codebar-ag-laravel-filament-json-field)

PHPackages © 2026

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