gosuperscript/schema
A Laravel package for building Schema.org structured data with a fluent PHP API. Generate JSON-LD for articles, products, organizations, breadcrumbs, and more, making it easy to add rich search results to your application. Clean, configurable output for SEO-friendly pages.
Architecture fit. gosuperscript/axiom is a PHP rules/expression-evaluation library (the terminology in this release — "presence" vs "equality" overloads, operator resolution ordering — describes a parser/evaluator that resolves operator semantics at expression-compile or evaluation time). For a Laravel codebase it fits the "business rules as data" slot: eligibility checks, pricing/discount conditions, feature gating, workflow guards, validation logic that product wants to change without a deploy. It is a library, not a Laravel-native package: expect to wire the service provider, config, and any cast/validation integration yourself unless upstream ships a Laravel bridge. Fit is good where you have many small, frequently changing predicates; poor where you have a handful of static conditionals that plain PHP expresses more clearly.
Integration feasibility. Low-to-moderate effort. A single class or facade call plus a rule source (config array, DB column, or file) gets you a working proof of concept. The real cost is not the wiring — it is building the guardrails: schema/contract for rule expressions, a place to store them, an authoring surface for non-engineers, and a test harness that pins expected outcomes per rule. Budget for that, not for the glue code.
Technical risk.
@robertvansteen) under an unfamiliar vendor namespace. Verify license, repo activity, issue responsiveness, and whether security disclosures have a channel before this carries revenue-affecting logic.Key questions.
Stack fit. Framework-agnostic PHP library, so Laravel fit is whatever we build around it. Recommended shape: a thin internal wrapper service (RuleEvaluator) that owns the axiom dependency, exposes a single evaluate(string $rule, array $context): bool, and is the only place the third-party API appears. Everything else in the app — controllers, jobs, models — depends on our wrapper. This contains upgrade blast radius to one file and one test suite, which is the correct posture for a 0.x dependency. Bind via a service provider, drive the rule source from config or an Eloquent model, and cache compiled rules if compilation is non-trivial.
Migration path. Do not migrate existing conditionals wholesale. Start greenfield: pick one rules-heavy, low-risk surface (e.g., promotional eligibility or notification routing) and implement it in axiom behind the wrapper. Keep the existing PHP logic in place as the reference implementation and run both in shadow mode on production traffic, logging divergences. Only cut over for that one surface once divergence is zero for a full cycle. Legacy conditionals outside that surface stay untouched — no rewrite mandate.
Compatibility. Pin to an exact patch (v0.6.10), not a caret range. Confirm PHP version support against our runtime and Laravel version constraints before anything else; a 0.x library's composer.json is often narrow. Check for conflicting global state (error handlers, custom autoloaders, static caches) — common in expression libraries and a frequent source of "works in isolation, breaks in the app" issues. Verify behavior under Octane/long-running workers if we use them: static evaluator state and memoized rules must be request-safe.
Sequencing.
Maintenance. Low code churn, meaningful ongoing discipline. Two recurring costs: (a) upgrade evaluation — every release, including patches like this one, must be run against the full rule corpus because 0.x patch releases can change evaluation semantics; (b) rule hygiene — expressions accumulate, drift, and outlive the business logic they encode. Without ownership and a deprecation path for stale rules, the rule store becomes an unreadable second codebase. Assign a named owner for the rule store, and require every rule to carry an owner, a purpose, and a review date.
Support. Support burden shifts from engineering to whoever authors rules. If product/ops can write expressions, they will write both valid-but-wrong rules and rules that parse but mean something unintended — and precedence subtleties (exactly the class of bug this release fixed) are not something a non-engineer will reason about correctly. Mitigation: a linter, a rule-preview/dry-run tool that shows evaluated output against sample contexts, and mandatory review before a rule goes live. Budget for building those; they are not optional if non-engineers touch expressions. Upstream support is a single maintainer with no SLA — assume we are on our own for triage and be prepared to vendor a fork if a blocking bug lands.
Scaling. Evaluation is in-process and CPU-bound; cost scales with rule count × context size × evaluation frequency, not with user count. Three concerns: hot-path evaluation on every request (cache compiled rules; memoize per-request results), unbounded expression complexity (cap depth/length at authoring time — a pathological rule is a self-inflicted DoS), and context assembly (fetching every field a rule might reference is often more expensive than evaluation itself; use lazy context resolution). For batch workloads, rules evaluated across large record sets need per-batch timing, since a slow rule multiplies by row count.
Failure modes.
Ramp-up. Engineering ramp is short — half a day to a working prototype. Organizational ramp is the long pole: 2–4 weeks to establish authoring conventions, the lint/preview tooling, the fixture-testing habit, and the upgrade ritual, assuming one engineer owns it. Sequence the shadow-mode pilot in parallel with tooling so the guardrails are proven against real rules before the second team adopts. Do not open rule authoring to non-engineers until lint, preview, and review are all in place — the first bad rule that ships silently will cost more trust than the tooling costs to build.
How can I help you explore Laravel packages today?