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

Eloquent Publishing Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Content Moderation & Scheduling: Enables publishing workflows for articles, blog posts, or marketing content where drafts must be scheduled or approved before public visibility.
  • Build vs. Buy: Avoids reinventing publishing logic (e.g., custom timestamps, queries) while maintaining flexibility for customization.
  • Roadmap: Supports phased rollouts (e.g., "planned" vs. "published" states) for gradual feature releases or A/B testing.
  • Use Cases:
    • Editorial Systems: Manage drafts, scheduled posts, and live content in a single workflow.
    • E-Commerce: Publish product listings or promotions at specific times (e.g., Black Friday sales).
    • APIs: Filter endpoints to return only published/unpublished records (e.g., /posts?published=true).

When to Consider This Package

  • Adopt if:

    • Your Laravel app requires time-based publishing (e.g., scheduled content, approval workflows).
    • You need consistent query methods (e.g., onlyPublished(), latestPlanned()) across multiple models.
    • Your team prefers traits over manual timestamp logic for DRY (Don’t Repeat Yourself) code.
    • You’re using Laravel 11+ and PHP 8.2+ (package’s supported versions).
  • Look elsewhere if:

    • You need advanced publishing rules (e.g., multi-step approvals, conditional publishing).
    • Your app uses non-Eloquent data models (e.g., raw SQL, MongoDB).
    • You require real-time collaboration (e.g., Google Docs-style editing) where this package’s event system is insufficient.
    • Your team lacks Laravel/PHP expertise to customize the trait or migrations.

How to Pitch It (Stakeholders)

For Executives: "This package streamlines content publishing with minimal dev effort. It adds a single trait to models, enabling scheduled releases, draft management, and filtered queries—reducing backend complexity while supporting features like time-sensitive campaigns or editorial workflows. MIT-licensed and actively maintained, it’s a low-risk way to standardize publishing logic across the app."

For Engineers: *"Replace manual published_at timestamps and custom queries with a battle-tested trait. Key benefits:

  • Migration helpers: Auto-adds published_at columns with $table->publishes().
  • Query shortcuts: Chain methods like Post::onlyPublished()->latestPublished().
  • Events: Hook into published, unpublished, etc., for notifications or analytics.
  • Customizable: Override column names or extend behavior via events. Requires Laravel 11+; drops legacy support. Example:
// Model
use Lemaur\Publishing\Database\Eloquent\Publishes;
class Post extends Model { use Publishes; }

// Migration
$table->publishes(); // Adds `published_at` column.
```*
*Tradeoff: Limited to Eloquent; not a full CMS, but solves 80% of publishing needs."*
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky