Shared base classes for the jeffersongoncalves family of Filament plugins. It removes the skeleton boilerplate every plugin used to copy-paste: the Plugin contract implementation, the Spatie PackageServiceProvider wiring, and Filament render-hook registration.
| Branch | Filament | PHP | Laravel |
|---|---|---|---|
| 1.x | 3.x | ^8.2 | ^11.0 |
| 2.x | 4.x | ^8.2 | ^11.0 |
| 3.x | 5.x | ^8.2 | ^11.0 |
- PHP 8.2 or higher
- Laravel 11.0 or higher
- Filament 5.x (3.x branch)
You can install the package via composer:
composer require jeffersongoncalves/filament-plugin-core:"^3.0"BasePlugin— implementsFilament\Contracts\Pluginwith the canonicalmake()/get()factory pair and no-opregister()/boot(). Subclasses only declaregetId().Concerns\InteractsWithPlugin— themake()/get()pair as a standalone trait, for plugins that cannot extendBasePlugin.BasePackageServiceProvider— extends Spatie'sPackageServiceProviderand addsregisterRenderHooks([$hook => $view])to collapse render-hook closures.
use JeffersonGoncalves\FilamentPluginCore\BasePlugin;
class MyPlugin extends BasePlugin
{
public function getId(): string
{
return 'my-plugin';
}
}use Filament\View\PanelsRenderHook;
use JeffersonGoncalves\FilamentPluginCore\BasePackageServiceProvider;
use Spatie\LaravelPackageTools\Package;
class MyServiceProvider extends BasePackageServiceProvider
{
public function configurePackage(Package $package): void
{
$package->name('my-plugin')->hasTranslations();
}
public function packageRegistered(): void
{
$this->registerRenderHooks([
PanelsRenderHook::HEAD_START => 'my-plugin::script',
]);
}
}composer testPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
