🔐 Symfony Security Basics #12 Fetching the current user is easy. Fetching it elegantly is even better. Let's compare a few approaches and finish with the expressive #[CurrentUser] attribute.
symfonycasts.comFetching the User in Services/ControllersShows three ways to fetch the currently logged-in user in Symfony—via AbstractController::getUser(), the Security service, and controller argument resolvers—and how to make the result type-safe so...
1 repost1 like