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.
"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:
*"This solves draft/revision needs with minimal boilerplate. Key benefits:
Schema::drafts() to auto-add required columns.HasOne, HasMany, and BelongsToMany syncs during publish.WithDraftsMiddleware.Trade-offs:
Implementation Plan:
HasDrafts trait to models (e.g., Post, Page).php artisan vendor:publish --tag=drafts-config to customize column names.saveAsDraft()/updateAsDraft() in admin flows.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."
How can I help you explore Laravel packages today?