Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Filament Publishable Laravel Package

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+.

View on GitHub
Deep Wiki
Context7
## 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',
       ]),
  1. How Does This Interact with Filament’s Access Control? Ensure publishable fields respect existing policies/roles (e.g., only editors can publish content).
  2. Is the AGPL License Acceptable? If not, consider alternatives like:
    • Building custom Filament components.
    • Using a different publishable package with a permissive license.
  3. What Are the Performance Implications? For large datasets, test if publishable filters (PublicationStatusFilter) add query overhead or require optimization (e.g., database indexes).
  4. How Will This Scale with Future Filament Updates? Monitor Filament’s breaking changes and plan for package updates or forks if needed.

Integration Approach

Stack Fit

  • Primary Use Case: Filament 4 admin panels managing publishable content (e.g., CMS, blogs, or dynamic visibility toggles for products/announcements).
  • Secondary Use Case: Could extend to Filament widgets (e.g., a "Recently Published" dashboard widget) or notifications (e.g., alerts for expiring content).
  • Non-Fit Scenarios:
    • Non-Filament admin panels (e.g., Laravel Nova, Backpack, or custom admin UIs).
    • Applications not using novius/laravel-publishable (would require adopting the trait first).
    • Filament v3 or older: Not supported; would need a fork or custom implementation.

Migration Path

  1. Prerequisite Validation:
    • Confirm Laravel 11+ and Filament 4+ compatibility.
    • Verify novius/laravel-publishable is installed (or plan to adopt it).
    • Check for conflicting Filament plugins that might override field rendering.
  2. Incremental Adoption Strategy:
    • Phase 1: Install the package and integrate into one Filament resource (e.g., PostResource).
      composer require novius/laravel-filament-publishable
      
    • Phase 2: Test basic publishable fields (PublicationStatus, PublishedAt, ExpiredAt) in forms and tables.
    • Phase 3: Extend to filters (PublicationStatusFilter) and bulk actions (PublicationBulkAction).
    • Phase 4: Customize fields (e.g., override labels, add validation) via Filament’s modifyFormFields.
    • Phase 5: Document internal patterns and train the team on publishable workflows.
  3. Customization Hooks:
    • Override default behavior using Filament’s modifiers:
      public static function modifyFormFields(Form $form): void
      {
          $form->modifyField('status', fn (PublicationStatus $field) => $field->required());
      }
      
    • Extend the package by creating custom fields (e.g., CustomPublishableField) if missing features are critical.

Compatibility

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.

Sequencing

  1. Step 1: Install and Configure
    • Add the package via Composer.
    • Publish translations if customization is needed.
  2. Step 2: Integrate into a Single Resource
    • Start with a non-critical resource (e.g., a test PageResource).
    • Add PublicationStatus, PublishedAt, and ExpiredAt to the form.
  3. Step 3: Test Publishable Workflows
    • Verify create/publish/expire cycles.
    • Check table display and filtering of publishable states.
  4. Step 4: Extend to Filters and Bulk Actions
    • Add PublicationStatusFilter to tables.
    • Test PublicationBulkAction for batch publishing.
  5. Step 5: Customize and Optimize
    • Adjust field behavior (e.g., hide ExpiredAt for drafts).
    • Optimize queries for large datasets (e.g., add indexes to published_at).
  6. Step 6: Roll Out to Production
    • Monitor for performance or UI issues.
    • Document the new workflow for the team.

Operational Impact

Maintenance

  • Low Overhead for Basic Use:
    • Minimal maintenance if the package remains stable. Focus on updating dependencies (Filament, Laravel Publishable).
  • Dependency Risks:
    • novius/laravel-publishable: Monitor for breaking changes (e.g., new trait methods, deprecated fields).
    • **Filament
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle