jeckel-lab/advanced-types
Advanced Types is a Laravel/PHP package for modelling domain values with reusable, type-safe objects and casts. It replaces loose primitives with expressive types, improving validation and clarity. Building blocks for custom value objects and Eloquent casts keep domain logic consistent and testable.
Architecture fit. Release 0.3.1 signals a deliberate architectural shift toward a framework-agnostic domain layer: exceptions are extracted into jeckel-lab/contract, made immutable, and limited to a single Domain Exception type. For a Laravel package, this is a sound pattern — it decouples error semantics from the framework and from the consuming application, and it aligns with DDD/hexagonal conventions where domain code should not leak transport or framework concerns. The package is still pre-1.0 (0.3.x), so this level of churn is expected but should be treated as unstable surface area.
Integration feasibility. Feasible but not frictionless. Three concrete changes affect consumers:
jeckel-lab/contract must be resolvable by Composer; any version constraint conflicts will block installation.catch block, instanceof check, or @throws annotation referencing the old classes will silently stop matching — a correctness risk, not just a compile error.Technical risk. Medium-to-high for existing adopters. The changes are breaking in substance (namespace relocation, throw-surface reduction) yet shipped under a patch version (0.3.1) in a 0.x line, which is acceptable-by-convention but easy to miss. Immutability is low risk in practice but will break any code that mutates exception context after construction. The single-exception policy is the largest behavioral risk: it reduces the ability to write precise catch clauses and may push consumers toward string matching.
Key questions.
jeckel-lab/contract share them?Stack fit. Standard Composer/Laravel integration. The added jeckel-lab/contract dependency is small and, by name, purpose-built — low intrinsic weight, but it is now a transitive requirement that must clear the application's dependency resolution.
Migration path. Treat this as a breaking upgrade even though the version is a patch:
jeckel-lab/contract resolves against the app's existing constraints.use, catch, instanceof, docblocks, config) and rewrite to the contract namespace.catch that relied on distinct exception types; re-express them against the new single Domain Exception, ideally via codes.Compatibility. Backward compatibility is not preserved for exception consumers. Forward compatibility is reasonable if the contract package is versioned in lockstep. Confirm PHP/Laravel matrix alignment before committing.
Sequencing. Do the dependency resolution first (it is the only true blocker), then the exception-reference sweep, then the catch-clause semantics audit, then failure-path testing. If the package is used in shared libraries, upgrade the library before downstream applications.
Maintenance. Pre-1.0 churn is the dominant cost. The centralization into a shared contract package is a net positive long-term — one place to version error semantics across the jeckel-lab ecosystem — but it raises the coordination burden now: two packages must move together.
Support. Fewer bespoke exception types inside the package means less to document, but the single-Domain-Exception model shifts diagnostic burden onto whatever metadata the exception carries. Support runbooks and log-based alerting that keyed on exception class names will need rework.
Scaling. No material runtime or throughput implications; this is an error-handling refactor. Operationally it scales fine. The scaling concern is organizational: every consuming team must perform the namespace and catch-clause migration in step.
Failure modes.
jeckel-lab/contract blocking deployment.catch (\Throwable) patterns that mask unrelated faults.Ramp-up. Low for new adopters (they learn the contract model from day one), moderate for existing teams (unlearning the old taxonomy, learning contract conventions, updating tooling and tests). Budget a focused half-day per consuming service for the sweep and failure-path validation, plus a shared review of how failure modes are now distinguished.
How can I help you explore Laravel packages today?