- How do I install optix/eloquent-draftable in a Laravel app?
- Install it with Composer using composer require optix/eloquent-draftable; Laravel auto-discovery registers the service provider. You then publish and run the package migration and add the draftable trait to the models that need a draft-and-publish workflow. Because the last release predates Laravel 9, confirm the illuminate and PHP constraints resolve on your stack before wiring it in.
- Which Laravel and PHP versions does optix/eloquent-draftable support?
- The latest release is dated 2020-10-13, and there are no published releases tracking Laravel 9, 10, 11, or 12 or PHP 8.2 and newer. The technical evaluation expects a hard Composer conflict on modern Laravel stacks unless the version constraint is patched. Check the package composer.json for its exact illuminate and php constraints before committing.
- Does optix/eloquent-draftable work with Laravel 10 or Laravel 11?
- There is no release that officially targets Laravel 10 or 11, so Composer resolution will likely fail or require a constraint patch. Realistic options are forking and maintaining the package, vendoring the trait source into your own namespace, or building the behavior first-party. For a single-purpose trait with zero dependents, vendoring is often cheaper than carrying a fork.
- How are drafts stored by eloquent-draftable: separate table or extra columns?
- The package is a trait plus migration hybrid, so it imposes a schema convention on your models rather than staying purely at the query layer. The draft may be stored as a self-referencing row, a polymorphic companion table, or parallel columns, and you should confirm which from the migration stub. That choice drives migration cost, query complexity, and whether UUID or ULID primary keys are supported.
- Are draft records excluded from normal Eloquent queries and soft deletes?
- Drafts should not leak into normal application queries, so verify how global scopes and soft deletes interact with the draftable trait. The evaluation flags global scope behavior and updated_at semantics as items to test explicitly. Add integration tests that assert draft rows are excluded from public listings.
- How are belongsToMany, hasMany, and media relations handled on a draft?
- The evaluation does not confirm how belongsToMany, hasMany, and media or attachment relations behave on a draft, so treat this as unverified. Test whether relations are copied, shared with the published record, or unsupported during draft creation and publish. Publishing by field-copy is lossy, while a pointer-swap approach is cleaner for related data.
- Does publishing a draft fire Eloquent events and invalidate caches?
- It is not documented whether publishing mutates the draft through Eloquent, which fires model events and observers, or through the query builder, which bypasses them. This matters for cache invalidation, search indexing, and any observer side effects. Write tests that assert the expected events fire on publish and revert.
- Can optix/eloquent-draftable handle scheduled publishing or editorial review?
- The package covers the core draft-and-publish step but does not appear to address editorial approval workflows, multi-author concurrency, or scheduled publishing. If your roadmap needs time-based release or review states, the evaluation estimates this package covers roughly 30 percent of that surface. Plan to build those layers yourself or choose a broader CMS-style solution.
- Is optix/eloquent-draftable actively maintained and tested?
- It is not actively maintained: the last release was in October 2020, the repo has about 27 stars and zero dependents, and there is a single agency maintainer with no visible governance or security policy. There is no ecosystem validation or observable production usage to learn from. Confirm whether a test suite exists and passes on your CI matrix before relying on it.
- Is there a maintained alternative, and should we use this package in production?
- Benchmark actively maintained draft or versioning packages with comparable ergonomics before committing, and consider building a first-party trait if your needs include concurrency, review, or scheduling. The MIT license is clean for commercial use with no attribution burden. For a production rollout, vendoring the few hundred lines under your own namespace with your own tests is often the safest path.