Get Current User In Symfony

[Solved] Get Current User In Symfony | Php Frameworks Symfony - Code Explorer | yomemimo.com
Question : get user symfony

Answered by : repulsive-ratel-9dj5vgih2ysa

$user = $this->get('security.token_storage')->getToken()->getUser();
$user->getUsername();

Source : https://stackoverflow.com/questions/7680917/how-do-i-get-the-entity-that-represents-the-current-user-in-symfony2 | Last Update : Wed, 16 Jun 21

Question : get current user in symfony

Answered by : bewildered-beetle-ezgglnix2ocn

$user = $this->get('security.token_storage')->getToken()->getUser();
$user->getUsername();

Source : | Last Update : Sat, 25 Jun 22

Answers related to get current user in symfony

Code Explorer Popular Question For Php Frameworks Symfony