onelearningcommunity/grease
Grease is a menu of independent, byte-identical performance tiers for Laravel's hot paths—Eloquent hydration, casting and serialization, events, Blade, config, validation, the container and router. Opt in per tier; the model trait is the zero-config starting point. Zero framework changes, and anythi...
setTable() on partitioned/archive tables) that previously forced teams to hand-audit or avoid the package on those paths.^12.69.2 || ^13.33). Teams must decide whether "stay current on Laravel patch releases" is an acceptable standing operational commitment.Adopt if:
^12.69.2 or ^13.33. Composer will not offer 0.9.1 below these floors — plan a composer update within your current major first.Model::query()->withCasts([...]), runtime setTable() (partitioned/archive tables), non-$table convention models, #[Refreshes], or GreaseRoutingServiceProvider — these paths were either broken or caveated before and are now parity-tested.Look elsewhere if:
GreaseRoutingServiceProvider on Laravel 12.69.2+, you are exposed to the route() parameter escaping bug (%, ?, # emitted raw, truncating paths). Upgrade is not optional in that configuration.For Executives: "Grease is a performance layer for our Laravel backend — a turbocharger for database queries. v0.9.1 is the stabilization release before 1.0: it fixes real correctness bugs (wrong table writes on partitioned/archive data, ignored query-time casts) and adds automated proof that our behavior matches stock Laravel. That converts this from 'a fast package we hope behaves the same' into 'a fast package with a test harness that proves it.' The trade-off is one new operational rule: we stay current on Laravel patch releases. Cost is a small, recurring maintenance line, not a license. Recommend a staging pilot now, with a go/no-go before 1.0."
For Engineering:
"v0.9.1 is a correctness release and the last stop before 1.0. Two things to know before we merge it. First, hard floors: Laravel ^12.69.2 || ^13.33 — Composer won't resolve below that, so composer update within our major first. Second, this package overrides framework internals and now deliberately mirrors each major's current patch behavior, so Laravel patch bumps become a re-validation event for us, not a no-op.
What got fixed that matters to us: Model::query()->withCasts([...]) is now applied on greased rows; runtime setTable() on the query's model now carries through to hydrated rows so save()/delete() hit the right table (the old caveat is gone, and convention-named models get their derived table memoized per class, with getTable() overrides called per row as vanilla); #[Refreshes] no longer drops after the first model per class; resolveClassAttribute() cache is property-keyed and reads trait attributes; Request::all() key ordering/collision behavior matches upstream per major.
Action item: if we're running GreaseRoutingServiceProvider on 12.69.2+, upgrade immediately — route() params were emitting %, ?, # raw and truncating URLs.
Test posture is the real story: HasGreaseWholeStateParityTest diffs a greased model's entire instance state against vanilla across cold/warm/hydrated, with a tripwire that fails when Laravel adds a new Eloquent attribute class; CI runs the full matrix (PHP 8.2–8.5 × Laravel 12/13 + lowest-deps) plus a weekly run against latest releases so upstream drift goes red within days. Livewire 4 is now covered. I'll gate the pilot on: our Laravel patch level, a scan for withCasts/setTable/routing-provider usage, and a benchmark against our current caching layer to quantify the actual win."
How can I help you explore Laravel packages today?