Plugins
Record Navigation
Seamless navigation through records in a Filament resource's view.
Table Builder
Action
Dark theme support
Yes
Multi language support
Yes
Compatible with the latest version
Supported versions: 3.x
Documentation

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

https://github.com/josespinal/filament-record-navigation/assets/10059/fbb09144-b0b5-411d-85a8-1d94eedcad01

#Installation

#Step 1: Require the package via Composer:

composer require josespinal/filament-record-navigation

The package will automatically register itself.

#Usage

#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

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

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;
}

#Changelog

Please see CHANGELOG for more information on what has changed recently.

#Credits

#License

The MIT License (MIT). Please see License File for more information.

José Espinal

Jose is a passionate entrepreneur from the Dominican Republic, known for his innovative Argentine-inspired restaurant concepts. With a deep love for cooking, Jose combines his culinary expertise with his technical skills in Laravel PHP, Python, and Rails programming. He is dedicated to creating businesses that allow him to balance his professional pursuits with quality time spent with his two children and exploring new technologies.

1
Plugins
36
Stars
Featured Plugins