innoge/laravel-policy-soft-cache
Laravel package that adds a soft cache layer for authorization policies, storing policy check results to avoid repeated Gate evaluations and speed up permission checks. It integrates with Laravel's authorization system to reduce policy overhead while keeping your existing policy code unchanged.
Architecture fit
@can, API resources serializing per-item permissions, and nested policy calls that re-dispatch the same ability.Integration feasibility
Technical risk
Key questions
composer.json constraints — does it drop Laravel 10/11 or an older PHP minor, making this a disguised breaking change for our oldest service?Gate::any/Gate::none/before() hooks keyed and handled?Stack fit
Migration path
composer require at ^1.6, publish config, enable per-policy via an explicit allowlist rather than globally. No application code change required.Compatibility
before() bypasses, guest users, soft-deleted models, policy methods with extra arguments) with a small test suite in our repo, not just theirs.Sequencing
composer.json change.update, delete, restore) on live evaluation.Maintenance
Support
Scaling
Failure modes
Gate::check or rely on before() ordering. Cover with tests.Ramp-up
Recommendation
How can I help you explore Laravel packages today?