harman/filament-nav-sort
最新稳定版本:v1.0.0
Composer 安装命令:
composer require harman/filament-nav-sort
包简介
Sorts Filament navigation items
README 文档
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.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-31