So, first I hope my title is not misleading. Please let me know if my title fits the question.
QUESTION. I'm using Laravel 5.3 and I'm trying to find a way to add an attribute "role" to Auth::user() so that I can access it like
Auth::user()->role.
Role is not a field in the user table used for authentication but it's a value I calculate to get. The reason I ask is I don't want to calculate role every single time I need the value, instead I want to set it when authentication succeeds then reuse it.
Any idea how I can do this?
Or is there any way I can persist a value through out the time a user is logged in so that I can calculate it once and reuse it?
via Vincent Hokie