symfony/security-core
Symfony Security Core provides the foundation for authentication tokens, roles, voters, role hierarchies, and access decision management. Use it to build flexible authorization logic decoupled from user providers and integrate fine-grained access checks into apps.
ROLE_ADMIN, hierarchical roles like ROLE_ADMIN → ROLE_USER) with minimal boilerplate.AuthenticationTrustResolver to support trust-based auth (e.g., remember-me cookies, impersonation).VoteObject::extraData (v8.0+) for dynamic permissions (e.g., isOwnerOf($resource)).ImpersonationToken.RoleHierarchy::buildRoleMap (v7.4+) to precompute role hierarchies for faster authorization checks.AccessDecisionManager logs (e.g., "User X denied access to Y at Z").Adopt if:
Look elsewhere if:
symfony/security-http or a dedicated package like league/oauth2-server).For Executives: "Symfony’s Security Core is the ‘Stripe for authentication’—a pre-built, scalable solution that eliminates 6+ months of custom auth development. It handles everything from role hierarchies to impersonation, reducing security risks while cutting costs. With 1.8K+ stars and Symfony’s backing, it’s the industry standard for PHP apps. For $0 (MIT license), we get enterprise-grade security without hiring specialized talent."
For Engineers: *"This package gives us:
#[IsGranted('ROLE_ADMIN')] attributes).VoteObject::extraData.security-bundle for HTTP auth), but the payoff is massive for complex apps."*For Security Teams: *"Symfony’s Security Core is OWASP-top10 hardened—it’s used by Fortune 500 companies (e.g., Spotify, SymfonyCasts). Key benefits:
AccessDecisionManager.
We’ll need to align with Symfony’s deprecation cycles (e.g., eraseCredentials() removal in v8.0), but the risk is minimal compared to custom code."How can I help you explore Laravel packages today?