Skip to content

How to access user attributes? #212

@Schop

Description

@Schop

Hi there,

As a long time user of CI3, I've been looking forward to using CI4, and now I finally have a small project that I can use to get my feet wet. There is a lot of learning to do, but it looks really promising, especially this Auth library.

So bear with me if my question is very trivial or dumb, jut trying to learn here.

I'm having some issues trying to understand how to access the attributes of a user. I'm using the user() function, with return a User entity.

Then I'm trying to access its attributes like so: user()->attributes['username'] but that doesn't work. How should I do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions