symfony/security-core
Symfony's core security library provides the infrastructure for authentication and authorization: user providers, tokens, voters, role hierarchies, and access decision management, decoupled from your application's actual authorization logic.
AccessDecisionManager, role hierarchy, authentication trust resolution) instead of hand-rolling role checks. Relevant when your roadmap includes roles beyond simple gates — hierarchical roles, attribute/context-based rules, per-tenant or per-object permissions — where Laravel's Gate/Policy layer starts needing custom plumbing.RoleHierarchy (e.g., ROLE_ADMIN implies ROLE_USER) and pluggable decision strategies (affirmative/unanimous/priority) are capability gaps in stock Laravel; if the product needs "admin inherits editor inherits viewer" semantics for many roles, this is directly on the roadmap.__unserialize hardening, login-link race narrowing, session-usage tracking. That is a strong argument for buying rather than owning this class of code.Gate::before callbacks.Consider it when:
symfony/* packages) and want one consistent authorization primitive rather than two.Look elsewhere when:
@can in Blade. Laravel's built-in Gate is the correct answer; this package adds concepts and wiring for no gain.UsernamePasswordToken, decision managers, and firewall-adjacent concepts are powerful but easy to misconfigure; security misconfiguration is an expensive failure mode.symfony/* packages on one branch) becomes your responsibility.For executives: Symfony Security Core is the authorization engine underneath one of the most widely deployed PHP frameworks — MIT-licensed, actively security-maintained across four release branches, with a predictable release rhythm and a track record of shipping fixes rather than sitting on them. The strategic question is not "is it good code" (it is) but "should we own authorization plumbing or consume it." Adopting it buys us a proven decision engine for complex, hierarchical, multi-surface permissions; declining it keeps us on Laravel's native Gate, which is simpler, free, and already in the stack.
For engineering: This is a low-level component, not an integration. There is no Laravel service provider — we would write and own the glue: user providers, token storage, voter registration, and a facade over AccessDecisionManager. Adopt it only if we have authorization requirements that outgrow Gate (role hierarchies, composable voters, enforcement outside HTTP, or shared policy across a Symfony and Laravel estate). If we do adopt, budget for: a thin integration layer with tests, a deliberate decision on which Symfony branch we track (8.x requires PHP 8.4), and a rule that all symfony/* packages stay on the same minor line to avoid dependency skew. Treat the security-sensitive nature of the component as a review gate — every voter and trust resolver we wire should be code-reviewed and covered by tests that assert deny-by-default behavior, not just the happy path. Recommendation: pilot behind one non-critical authorization surface before committing the platform's access control to it.
How can I help you explore Laravel packages today?