novius/laravel-filament-publishable
Add Laravel Publishable support to Filament resources: ready-made form fields, table column, filter, and bulk action to manage publication status plus published/expired dates for your Eloquent models. Compatible with Laravel 11+, Filament 4+.
## Technical Evaluation
### **Architecture Fit**
- **Tight Integration with Laravel Publishable**: The package is a **specialized bridge** between Laravel Publishable (a model trait for managing publishable content) and Filament 4, making it ideal for applications requiring **publishable workflows** (e.g., CMS, blogs, or dynamic content visibility). It extends Filament’s **resource-based architecture** without disrupting existing patterns, ensuring modularity.
- **Filament-Centric Design**: Leverages Filament’s **form schema**, **table columns**, and **filters** to provide publishable-specific UI components (`PublicationStatus`, `PublishedAt`, `ExpiredAt`). This aligns with Filament’s declarative approach, reducing boilerplate for common publishable use cases.
- **Decoupled from Core Filament**: The package **does not override** Filament’s default behavior; it **augments** it. This ensures backward compatibility and minimal risk of conflicts with other Filament plugins.
### **Integration Feasibility**
- **Low-Coupling Adoption**: Integration requires **only adding fields** to existing Filament resources (e.g., `PostResource`). No changes to Filament’s core or model logic are needed beyond using the `Publishable` trait.
- **Dependency Synergy**: Works seamlessly with **Filament 4+** and **Laravel 11+**, which are modern stacks. If the application already uses these, integration is **plug-and-play**.
- **Publishable Trait Dependency**: Assumes models already use `novius/laravel-publishable`. If not, this introduces a **new dependency chain** (though the package abstracts its usage well).
- **No Database Migrations**: Fields map to existing publishable trait attributes (e.g., `published_at`, `expired_at`), so no schema changes are required.
### **Technical Risk**
- **Version Lock-In**: Hard dependency on **Filament 4** and **Laravel 11+**. Downgrading either could break compatibility, requiring **parallel maintenance** of older branches.
- **Low Adoption Risk**: With **only 2 stars and 0 dependents**, the package may lack **community validation** or **enterprise-grade support**. Risk of **abandonment** or incomplete feature sets for edge cases.
- **AGPL License Constraints**: The **GNU AGPL v3** license may conflict with proprietary applications. Requires **legal review** before adoption, especially if the application is closed-source.
- **Undocumented Edge Cases**: Limited examples for **complex publishable workflows** (e.g., recursive publishable relationships, custom validation rules, or bulk publish actions with constraints).
- **Potential for Overhead**: While lightweight, adding multiple publishable fields to large forms/tables could **bloat the UI** if not carefully managed.
### **Key Questions**
1. **Is Laravel Publishable Already in Use?**
If not, evaluate the **effort to migrate models** to the `Publishable` trait (e.g., adding `published_at`, `expired_at`, and `status` fields).
2. **Are There Existing Filament Resources That Could Leverage This?**
Prioritize resources managing **content with publishable states** (e.g., blog posts, marketing pages, product listings) for the highest ROI.
3. **What’s the Fallback for Missing Features?**
Could custom Filament fields (e.g., `Select`, `DatePicker` with custom logic) replicate functionality? For example:
```php
Select::make('status')
->options([
'draft' => 'Draft',
'published' => 'Published',
'expired' => 'Expired',
]),
PublicationStatusFilter) add query overhead or require optimization (e.g., database indexes).novius/laravel-publishable (would require adopting the trait first).novius/laravel-publishable is installed (or plan to adopt it).PostResource).
composer require novius/laravel-filament-publishable
PublicationStatus, PublishedAt, ExpiredAt) in forms and tables.PublicationStatusFilter) and bulk actions (PublicationBulkAction).modifyFormFields.public static function modifyFormFields(Form $form): void
{
$form->modifyField('status', fn (PublicationStatus $field) => $field->required());
}
CustomPublishableField) if missing features are critical.| Component | Compatibility | Notes |
|---|---|---|
| Filament 4+ | Fully supported. | May break with Filament 3 or older. |
| Laravel 11+ | Optimized for new features (e.g., enums, model observers). | Older versions may require polyfills. |
| Publishable Trait | Assumes models use novius/laravel-publishable. |
Conflicts may arise with custom publishable logic. |
| Database | No schema changes required. | Fields must align with publishable trait attributes (e.g., published_at). |
| Filament Plugins | Risk of field rendering conflicts if other plugins modify Filament’s core. | Test in isolation. |
| Localization | Supports language customization via vendor:publish --tag="lang". |
Override translations in resources/lang/vendor/filament-publishable. |
PageResource).PublicationStatus, PublishedAt, and ExpiredAt to the form.PublicationStatusFilter to tables.PublicationBulkAction for batch publishing.ExpiredAt for drafts).published_at).How can I help you explore Laravel packages today?