- What is liberusoftware/module-cms-contracts used for?
- It provides shared interfaces, events, and data transfer objects used across Liberu CMS modules. It defines abstractions for content, pages, and publishing so modules can integrate through a stable API surface. Because it depends on nothing, it sits at the base of the module dependency graph.
- Do I need to install this package directly?
- Usually it is pulled in transitively as a dependency of other Liberu CMS modules. Install it directly only if you are building a module or package that needs the shared contracts. Composer will normally resolve it automatically.
- Which Laravel versions does this package support?
- The package is described as framework-agnostic, so its contracts are not tightly coupled to a specific Laravel release. Check the package composer.json for the exact PHP and illuminate/support constraints before upgrading. Test against your application's Laravel version.
- Does this package depend on Laravel or other packages?
- No, it is designed to depend on nothing and be depended on by everything. That keeps the shared abstractions lightweight and avoids circular dependencies between CMS modules. Laravel integration is provided by the modules that implement these contracts.
- How do I implement the CMS contracts in my own module?
- Create classes that implement the relevant interfaces for content, pages, and publishing. Register bindings in a Laravel service provider so the container can resolve your implementations. Then dispatch and listen for the shared events as needed.
- Can I use these contracts outside of Laravel?
- The blurb describes the API surface as framework-agnostic, so the interfaces and DTOs can be referenced in plain PHP code. However, the events and container bindings are typically used within Laravel modules. Verify each contract for framework-specific assumptions.
- What DTOs and events are included?
- The package contains DTOs and events shared across CMS modules, supporting content, page, and publishing workflows. The exact class list should be confirmed in the source or generated API docs. Treat the contracts as the stable public surface rather than implementation details.
- How do I test a module that depends on these contracts?
- Mock or stub the interfaces in unit tests, since the package provides abstractions rather than concrete implementations. Use Laravel's container to bind test doubles for the contracts your module consumes. Integration tests should exercise your real implementations.
- Is this package safe to use in production?
- It is a contracts-only package, so it contains no runtime behavior beyond interfaces, events, and DTOs. Production risk is low, but you should still pin versions and review changes. Confirm maintenance activity in the repository before relying on it long term.
- What are alternatives to using shared contracts?
- You could define your own interfaces inside each module, but that risks duplication and inconsistent APIs across the CMS. A shared contracts package keeps modules decoupled and interoperable. Alternatives include using generic package-level interfaces, though they won't match Liberu CMS conventions.