Skip to content

Tiers at a Glance

Grease is a menu, not a monolith — a set of independent opt-ins, each removing a stable fact Laravel recomputes per row, render, request, or query. This page ranks them by what it costs you to turn on, what you're promising (almost always nothing), and what it's worth.

If you read nothing else

Add HasGrease to your models. Then add HasGreasedAcyclicSerialization too — unless your models are self-referential trees. Those two are the no-brainers: trivial to enable, byte-identical, and they carry the biggest, broadest wins.

Legend — Gain is the expected impact on the workload the tier targets (not a universal request-wide number; see each page for the measured figure). 🔥 small or conditional · 🔥🔥 solid · 🔥🔥🔥 broad and large. Risk None means byte-identical to vanilla with nothing to promise; the parity suite proves it.

Your fire may vary. These flames are our boxes and our workloads — the only benchmark that counts is yours, on your hardware, with your traffic. Measure it.

Start here — the no-brainers

Add a trait to your models. Nothing to configure, nothing app-wide.

TierSpeeds upEnableRiskGain
Model (how)the whole model read/write path — hydration, casting, dates, serialization, dirty-check, m2m pivotsuse HasGrease;None🔥🔥🔥
Acyclic serializationtoArray / queue / touch — drops the debug_backtrace recursion guarduse HasGreasedAcyclicSerialization;You promise no self-referential graphs🔥🔥🔥

Add a trait — per model, à la carte

Independent model opt-ins, deliberately not in HasGrease because they're narrow or carry a promise.

TierSpeeds upEnableRiskGain
Decimal castsdecimal:N reads — skips the Brick\Math round-tripuse HasGreasedDecimalCasts;None (fires on MySQL/PostgreSQL)🔥 — decimal-dense financial models
Builder dispatchEloquent builder __call verb resolutionuse HasGreasedQueries;None🔥 — query-construction-heavy paths

Register a provider — app-wide

One line in a service-provider list. None are auto-discovered.

TierSpeeds upEnableRiskGain
Eventsevery dispatchGreaseEventServiceProviderNone🔥🔥
Blade@props + attribute-merge per componentGreaseViewServiceProviderNone🔥🔥
Configconfig() reads (scales with call volume)GreaseConfigServiceProvider (+ grease:config-cache)None🔥🔥
Validationrule parsing per validationGreaseValidationServiceProviderNone🔥 — validating endpoints
Router + URLmiddleware resolve+sort, route() assemblyGreaseRoutingServiceProvider (+ grease:route-cache)None🔥 — compounds with request volume
View cacheview name→path resolutionsame provider + grease:view-cacheNone🔥

One line at the app entry — heavier opt-in

These tiers live below the provider layer (the container and request are built before any provider runs), so they need a one-line edit in your app's bootstrap. Worth it for DI- or input-heavy apps, and the whole story under Octane.

TierSpeeds upEnableRiskGain
Containerconstructor reflection per service resolveGrease\Container\Application in bootstrap/app.phpNone🔥🔥 — compounds under Octane
Requestinput() / all() per accessGrease\Http\Request::capture() in public/index.phpNone🔥🔥

Every tier is a method override that falls back to parent::, so a non-greased model — or a tier you didn't opt into — is untouched. See Benchmarks for the cumulative-stack numbers when several are layered, and Caveats for the precise narrowings.

Byte-identical to vanilla, or it's a failing test. · MIT Licensed