Download the PHP package bezhansalleh/filament-plugin-essentials without Composer
On this page you can find all versions of the php package bezhansalleh/filament-plugin-essentials. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bezhansalleh/filament-plugin-essentials
More information about bezhansalleh/filament-plugin-essentials
Files in bezhansalleh/filament-plugin-essentials
Package filament-plugin-essentials
Short Description A collection of essential traits that streamline Filament plugin development by taking care of the boilerplate, so you can focus on shipping real features faster
License MIT
Homepage https://github.com/bezhansalleh/filament-plugin-essentials
Informations about the package filament-plugin-essentials
Filament Plugin Essentials
A collection of essential traits that streamline Filament plugin development by taking care of the boilerplate, so you can focus on shipping real features faster
Table of Contents
- Filament Plugin Essentials
- Table of Contents
- Features
- Requirements
- Installation
- For Plugin Developers
- 1. Add traits to your plugin class
- 2. Add matching traits to your forResource classes
- 3. Set defaults for your plugin (optional)
- How values are resolved
- How Plugin Users Can Configure Your Plugin
- Multi-forResource configuration
- Dynamic values with closures
- Plugin \& Resource Trait Mapping
- Configuration Options Provided by Each Trait
HasNavigationHasLabelsHasGlobalSearchBelongsToParentBelongsToTenantWithMultipleResourceSupport- Limitations
- Todo
- Testing
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
Features
- Easily Configure
- 🎯 Navigation - Complete control over resource navigation (labels, icons, groups, sorting, badges)
- 🏷️ Label - Model labels, plural forms, title attributes, and casing options
- 🔍 Global Search - Searchability controls, result limits, and case sensitivity options
- 👥 Resource Tenant options - Tenant scoping and relationship configuration
- 🔗 Parent Resource - Hierarchical resource relationships
- ⚙️ Multi-Resource Configuration - Different settings per
Resourcein a single plugin - 📦 3-Tier Default System - User overrides → Plugin defaults → Filament defaults
- 🔄 Dynamic Values - Closure support for conditional logic and real-time data
- 🛠️ Developer-Friendly - Minimal boilerplate with maximum customization
Requirements
Installation
For Plugin Developers
1. Add traits to your plugin class
2. Add matching traits to your forResource classes
3. Set defaults for your plugin (optional)
[!NOTE] Defaults arrays are keyed by property name (
shouldRegisterNavigation,isGloballySearchable,hasTitleCaseModelLabel, …), not by setter name. The copy-paste blocks under each trait below list the correct keys.
Alternatively, define a getDefault{Property}() method for any property — it takes precedence over the getPluginDefaults() array and receives the resource class being resolved:
The legacy flat structure (UserResource::class => [...] at the top level of the defaults array) keeps working alongside the nested 'resources' key.
How values are resolved
For every configurable property, the first tier with an answer wins:
- Per-resource user override —
->forResource(UserResource::class)->navigationIcon(...) - Global user override —
->navigationIcon(...) - Plugin developer defaults —
getDefault{Property}()method, thengetPluginDefaults()['resources'][ResourceClass][property], then legacygetPluginDefaults()[ResourceClass][property], thengetPluginDefaults()[property] - Resource / Filament defaults — the resource's own static configuration, then Filament's native behavior (including panel-level configuration such as
subNavigationPosition)
Passing null explicitly to a nullable setting is an answer, not a reset — ->navigationIcon(null) removes the icon even when the plugin ships a default or the resource declares its own static icon.
How Plugin Users Can Configure Your Plugin
When plugin developers use these traits, users of their plugins get a fluent API to configure them. The available configuration options depend on which traits the plugin developer chose to include.
Configure any plugin that uses these traits:
Multi-forResource configuration
Dynamic values with closures
Plugin & Resource Trait Mapping
Each plugin trait has a corresponding forResource trait that must be added to your forResource classes:
| Plugin Trait | Resource Trait |
|---|---|
Plugin\HasNavigation |
Resource\HasNavigation |
Plugin\HasLabels |
Resource\HasLabels |
Plugin\HasGlobalSearch |
Resource\HasGlobalSearch |
Plugin\BelongsToParent |
Resource\BelongsToParent |
Plugin\BelongsToTenant |
Resource\BelongsToTenant |
Plugin\WithMultipleResourceSupport |
(No forResource trait needed - enables multi-forResource configuration) |
Configuration Options Provided by Each Trait
HasNavigation
Copy-paste defaults:
HasLabels
Copy-paste defaults:
HasGlobalSearch
Copy-paste defaults:
BelongsToParent
Copy-paste defaults:
BelongsToTenant
Copy-paste defaults:
WithMultipleResourceSupport
Enables per-forResource configuration:
Limitations
Route-phase configuration cannot be plugin-delegated. Filament resolves resource slugs, clusters, and route prefixes while registering routes at application boot — before any panel boots and before filament()->getPlugin() can target the correct panel. Plugin configuration only becomes reliable per-request, after the panel boots. That is why these traits cover navigation, labels, global search, tenancy, and parent resources, but not slug() or cluster assignment.
Todo
- [ ] Add support for pages
- [ ] ...features you want to see? [Open an issue]()
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Bezhan Salleh
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-plugin-essentials with dependencies
filament/filament Version ^4.0|^5.0
spatie/laravel-package-tools Version ^1.0
illuminate/contracts Version ^11.28|^12.0|^13.0