lemaur/eloquent-publishing
Add publishing support to Laravel Eloquent models with a simple trait. Manage publish dates, query scopes and helpers, plus custom migration blueprint methods to quickly add publishing columns and build publishable content workflows.
Pros:
Publishes) aligns with Laravel’s conventions (e.g., traits for reusable model behavior).publish(), unpublish(), isPublished(), etc.), reducing boilerplate and improving readability for content lifecycle management (e.g., scheduled posts, drafts, or archiving).onlyPublished(), latestPlanned(), etc.), enabling efficient filtering and sorting without manual SQL or complex Eloquent logic.publishing, published, etc.), allowing for decoupled side effects (e.g., notifications, analytics, or workflow triggers).$table->publishes()), standardizing database schema changes across models.Cons:
SoftDeletes trait, which could conflict with unpublish() logic if both are used.publishesTz() supports timezone-aware timestamps, the default behavior may not align with applications requiring strict timezone controls (e.g., global audiences).published_at column (or custom-named equivalent) to tables. This is non-destructive but requires migration planning.published_at columns (via dropPublishes()) could inadvertently remove critical data if not tested thoroughly.published could trigger unintended actions (e.g., sending emails or updating caches) if not properly guarded.isPlanned()) relies on server time, which may not sync with user expectations (e.g., timezone offsets or daylight saving).NULL timestamps or time manipulation.published_at columns in tables? How will they be handled during migration?unpublish() interact with SoftDeletes?onlyPublished()) impact performance for large datasets? Are indexes needed on published_at?published, unpublished) critical for auditing? How will they be logged/monitored?published_at column name acceptable, or will custom names be required across models?published_at values) be handled during migration?publishesTz()) may require database-specific configurations.How can I help you explore Laravel packages today?