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

oddvalue/laravel-drafts

Drop-in drafts and revisions for Laravel Eloquent models. Create, save, publish, and preview revisions with a simple API, middleware support, and minimal setup—ideal for CMS-style editing workflows without building a custom versioning system.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Content Moderation Workflows: Enables draft/publish workflows for editorial teams (e.g., blogs, marketing sites) where content must be reviewed before going live.
  • Multi-Environment Sync: Supports staging/production parity by maintaining revision history without duplicating databases.
  • A/B Testing & Experimentation: Tracks iterations of content (e.g., marketing copy) without breaking live versions.
  • Build vs. Buy: Avoids custom development for draft/revision systems, reducing technical debt and accelerating time-to-market.
  • Compliance & Auditing: Retains revision history for regulatory requirements (e.g., financial disclosures, legal documents).
  • Collaborative Editing: Allows multiple authors to work on drafts simultaneously (e.g., CMS platforms, internal wikis).

When to Consider This Package

  • Avoid if:
    • Your use case requires fine-grained access control (e.g., role-based draft permissions) beyond the package’s publisher relation.
    • You need branch/merge-like workflows (e.g., Git-style collaboration) instead of linear revisions.
    • Your team lacks Laravel expertise; the package assumes familiarity with Eloquent and migrations.
    • You’re using non-relational databases (e.g., MongoDB) or need custom storage backends.
    • Performance is critical: Revisions are stored as separate rows, which may impact queries for high-traffic models.
  • Consider alternatives if:
    • You need offline drafts (e.g., mobile apps syncing later).
    • Your revisions require binary diffs (e.g., images, PDFs) instead of full copies.
    • You’re using Laravel Nova or Forge: These may have built-in draft solutions.

How to Pitch It (Stakeholders)

For Executives:

"This package lets us ship content faster and safer. Editorial teams can draft, review, and publish without breaking live sites—like a built-in version control for our database. It’s MIT-licensed, actively maintained, and used by [X] teams at [Y] companies. For example, our blog could reduce publishing errors by 30% while adding audit trails for compliance. The cost? Zero—it’s a drop-in Laravel package with no vendor lock-in."

Key Metrics to Track:

  • Time saved on content approvals (e.g., "Reduced publishing delays by 40%").
  • Error reduction in live content (e.g., "Zero broken pages post-launch").
  • Developer velocity (e.g., "Cut custom draft-system dev time by 80%").

For Engineering:

*"This solves draft/revision needs with minimal boilerplate. Key benefits:

  • Zero migrations: Uses Schema::drafts() to auto-add required columns.
  • Relation support: Handles HasOne, HasMany, and BelongsToMany syncs during publish.
  • Preview mode: Toggle live vs. draft views in a single line of code.
  • Middleware: Protect draft routes with WithDraftsMiddleware.
  • Laravel 12+ ready: Actively maintained with PHP 8.4+ support.

Trade-offs:

  • Revisions are row-level copies (not diffs), so storage scales linearly.
  • No soft-deletes for revisions by default (but can be extended).

Implementation Plan:

  1. Add HasDrafts trait to models (e.g., Post, Page).
  2. Run php artisan vendor:publish --tag=drafts-config to customize column names.
  3. Use saveAsDraft()/updateAsDraft() in admin flows.
  4. Add WithDraftsMiddleware to protected routes.

Example Workflow:

// Admin creates a draft
$post = Post::createDraft(['title' => 'New Feature']);

// Reviewer publishes it
$post->update(['is_published' => true]);

// Public sees live version
$posts = Post::published()->get(); // Only published records
```"

**Alternatives Considered**:
- **Custom solution**: Would take 2–3 weeks to build; this takes **<1 day**.
- **Third-party CMS**: Adds vendor dependency; this integrates natively with Laravel."
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.
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
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope