Releases: One-Learning-Community/grease
Releases · One-Learning-Community/grease
v0.1.0 — first release
First release. Opt-in performance for Laravel's hot paths, with output asserted byte-identical to vanilla Eloquent across every cast type, edge value, and dirty-check.
Install
composer require onelearningcommunity/greaseuse Grease\Concerns\HasGrease;
class User extends Model
{
use HasGrease;
}What's in it
Four composable per-model tiers over a single lazily-built, per-class blueprint (HasGrease, or the GreasedModel base class):
HasGreasedHydration— removes the per-rowReflectionClass, the per-instance casts rebuild, andnewInstance's redundant work during hydration.HasGreasedAttributes— memoizesgetCasts/getCastType/getDates/ mutator probes /getDateFormat; a divergence guard keeps runtimemergeCasts()/withCasts()correct.HasGreasedCasts— flyweight cast dispatch replacing the per-accessswitch, an enum fast path that delegates conversion to the framework, and synonym-cast flyweight dedup.HasGreasedSerialization— eliminates the Carbon parse-and-reformat round-trip for date serialization when a per-class probe certifies a byte-identical rewrite; defers to vanilla otherwise.
Grease\Events\Dispatcher — a drop-in, behaviour-identical faster event dispatcher (no-listener fast path, cached listener resolution, pre-compiled wildcard patterns), opt-in via GreaseEventServiceProvider. Speeds up every dispatch app-wide, not just model events.
Requirements
PHP 8.2+ · Laravel 12 / 13
Links
📖 Documentation · 📋 Changelog
Built proudly with Claude.