Skip to content
Discussion options

You must be logged in to vote

The attributes of your eloquent models that are saved to the database work a bit differently than the normal class properties.
The "database" attributes like User::email are actually stored in the $attributes property (see HasAttributes-trait, which the eloquent Model class uses). Under the hood you can access $user->email, even though you did not explicitly declare it through PHPs magic-methods __get and __set. These basically delegate the calls from $user->email to actually return $user->attributes['email'] (simplified).

If you just want IntelliJ to stop complain and want a better experience with IntelliJ and Laravel in general, you can install barryvdh/laravel-ide-helper, which scans y…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sscharfenberg
Comment options

Answer selected by sscharfenberg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants