Getting info on the currently logged in user Trying to get the currently logged in user's groups. Trying to get at that by using the user ID. I am currently testing as Admin - user number 1.

Craft::$app-&gt;getUser()-&gt;id


Returns a user ID (11) that does not exist in the Users table. The Users table has ID's of 1, 20, 21.

How do I get user ID or more specifically, the currently logged in user's groups?
Craft::$app-&gt;getUser()


returns only the user service/component. You should read the docs about that

What you want is the current Identity

Craft::$app-&gt;getUser()-&gt;getIdentity()