harman/filament-nav-sort

Sorts Filament navigation items

Installs: 6

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/harman/filament-nav-sort

v1.0.0 2025-08-31 13:53 UTC

This package is auto-updated.

Last update: 2025-12-31 00:34:24 UTC


README

Sorts Filament navigation items in the sidebar. Super light weight and easy to use.

Installation

You can install the package via composer:

composer require harman/filament-nav-sort

and publish the config file using the following command:

php artisan vendor:publish --provider="Harman\FilamentNavSort\FilamentNavSortServiceProvider"

Usage

Step 1

Add HasNavSort trait to all the filament resources and pages.

use Harman\FilamentNavSort\HasNavSort;
class UserResource extends Resource
{
    use HasNavSort;
//--
use Harman\FilamentNavSort\HasNavSort;
class Settings extends Page
{
    use HasNavSort;
//--

Step 2

Create an Enum anywhere in your laravel project. For Example : You can create a php file in the directory : "App → Filament → Enums → NavSortEnum.php" and create an enum like this:

namespace App\Filament\Enums;
enum NavSortEnum
{
    case UserResource;
    case Settings;
    case News;
    case TestPage;
    //--
    //Add all the resources and pages classnames here
}

use classname of resource or page as the case.
For example (For Resources) : UserResource, PostResource, CategoryResource etc.
For example (For Pages) : Settings, Author, AuthorPage, TestPage, SettingsPage etc. \

Important: Arrange the cases in the enum in the order you want them to appear in the navigation.

Step 3

Open config/filament-nav-sort.php and add the enum to the config file.

use App\Filament\Enums\NavSortEnum;
return [
    'enum' => [
        NavSortEnum::class
    ]
];

OR

return [
    'enum' => [
        App\Filament\Enums\NavSortEnum::class
    ]
];

License

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