ÁobezhanSalleh/filament-panel-switch
The Panel Switch Plugin for Filament offers a robust and customizable component for switching between panels in applications built with FilamentPHP.
Thành tựu nổi bật
Những danh hiệu mới nhất của dự án
#1 Repository Của Ngày
🔀 Panel Switch — Chuyển panel Filament nhanh gọn, tùy biến sâu
Plugin nhẹ cho Filament 4.x/5.x thêm component chuyển panel vào header, tự lọc theo quyền user, 2 style giao diện, cấu hình đầy đủ qua fluent API.
filament-panel-switch của bezhanSalleh giải quyết bài toán phổ biến khi xây dựng ứng dụng multi-panel với FilamentPHP: admin, developer, customer portal… mỗi vai trò thấy panel khác nhau. Thay vì hard-code dropdown hay viết custom component, package này tích hợp sẵn vào header Filament, chỉ hiện panel mà user có quyền truy cập (dựa trên canAccessPanel của User model), và cho dev kiểm soát mọi chi tiết hiển thị qua API fluent.
✨ Điểm nổi bật
- Tự động theo quyền: Chỉ hiển thị panel khi user có quyền truy cập ≥ 2 panel, không cần config thêm.
- Hai style giao diện: Modern (mặc định) dùng Modal Blade component của Filament, có slide-over; Simple kiểu dropdown tối giản.
- Fluent configuration:
modalHeading(),modalWidth(),slideOver(),panels([...]),labels(),icons(),sortOrder(),placement()— tất cả chainable. - Dynamic panels:
panels()chấp nhận closure trả về mảng panel ID, hữu ích cho logic phân quyền phức tạp. - Validate panel ID: Ném
InvalidArgumentExceptionnếu panel khai báo không tồn tại trong Filament. - Theme-ready: Yêu cầu thêm
@sourcevàotheme.cssvànpm run build— tuân thủ theming chuẩn Filament. - Hỗ trợ Filament 4.x & 5.x: Version 2.x/3.x cùng兼容 hai major version hiện tại.
💡 Vì sao đáng chú ý
Package tập trung làm một việc và làm tốt: chuyển panel. Không kéo dependency thừa, không ép buộc opinionated UI — dev chọn Modern hay Simple, modal hay slide-over, width sm/md/lg, vị trí left/right, icon Heroicons hay custom Blade component. Logic lọc panel theo canAccessPanel tận dụng sẵn authorization của Filament, tránh duplicate permission logic. Closure trong panels() cho phép quyết định runtime (ví dụ: chỉ hiện panel dev khi app()->environment('local')). Gọn, an toàn, dễ mở rộng — đúng chất "Filament way".
#FilamentPHP #FilamentPlugin #AdminPanel #OpenSource #TiniX
Dự án tương tự
Khám phá các dự án và mô hình AI khác có sự tương đồng.
The multi-level select field lets you pick one or multiple options from a list that is neatly organized into different levels.
Manage your media files using spatie media library with easy to use GUI for FilamentPHP
This package introduces eight new form fields for FilamentPHP. Four of them are based on Radio, and four are based on CheckboxList.
Laravel Kanban boards with intelligent pagination, drag-and-drop ordering, and flexible integration patterns for Filament and Livewire applications.