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 Publishable Laravel Package

pawelmysior/laravel-publishable

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Content Moderation Workflows: Enables soft-deletion-like functionality for published content (e.g., blog posts, articles, or product listings) without permanently removing records from the database. Supports gradual rollouts (e.g., "publish to a subset of users first").
  • A/B Testing & Feature Flags: Use published_at timestamps to gate features/updates behind time-based triggers (e.g., "publish this update to 10% of users after 7 days").
  • Compliance & Auditing: Track when content was published/unpublished for regulatory requirements (e.g., GDPR, financial disclosures) or internal audits.
  • Build vs. Buy: Avoid reinventing a publish/unpublish system for Eloquent models, reducing dev time and technical debt. Low-risk adoption due to MIT license and minimal dependencies.
  • Roadmap Prioritization: Quickly prototype publish/unpublish functionality for MVP features (e.g., "launch a news section with scheduled publishing").
  • Multi-Tenant Isolation: Combine with tenant-aware queries to publish content only for specific tenants (e.g., SaaS platforms with region-specific releases).

When to Consider This Package

  • Hard Delete Requirements: If you need permanent deletion (not soft toggles), use Laravel’s built-in SoftDeletes or Delete behavior instead.
  • Complex Publish Logic: For advanced rules (e.g., publish based on user roles, geolocation, or custom business logic), extend the trait or use policy-based authorization.
  • Non-Timestamp Publish States: If you need non-time-based publish states (e.g., boolean flags, multi-state workflows), consider a custom trait or state machine package.
  • High-Performance Needs: For tables with billions of rows, ensure published_at indexing is optimized (this package assumes standard indexing).
  • Existing Solutions: If your app already uses a CMS (e.g., Strapi, Craft CMS) or ORM with built-in publish features, evaluate integration effort vs. value.
  • Laravel Version Mismatch: Avoid if your project uses an unsupported Laravel version (e.g., 8.x with this package).

How to Pitch It (Stakeholders)

For Executives: *"This package lets us toggle content visibility (e.g., blog posts, product listings) with a single line of code—no extra infrastructure. For example, we can:

  • Launch features gradually (e.g., publish a new UI to 5% of users first).
  • Comply with regulations by tracking when content goes live (critical for legal/audit teams).
  • Reduce dev time by avoiding custom publish/unpublish logic, freeing engineers for higher-impact work. It’s lightweight, battle-tested, and integrates seamlessly with Laravel’s Eloquent. The cost? Zero—it’s open-source and MIT-licensed."*

For Engineers: *"This trait adds three key methods to Eloquent models:

  1. published()/unpublished() scopes for querying (e.g., Post::published()->get()).
  2. isPublished() for model-level checks.
  3. publish()/unpublish() actions with published_at timestamps. Why use it?
  • 5 minutes to implement: Just add a published_at column and the trait.
  • No ORM bloat: Unlike full CMS systems, it’s minimal and Laravel-native.
  • Future-proof: Supports Laravel 9–12 with versioned releases. Trade-offs: Assumes timestamp-based publishing (not boolean flags) and requires a migration. For complex needs, we can extend it or pair it with policies."*
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