I make a cURL request to an API
http://site/user
I got back this response
data: Object
first_name: "Bob"
last_name: "Jones"
I grab the first name and last name and concatenate them together and stored into a variable call $name
.
$fn = VSE::user('first_name',$username);
$ln = VSE::user('last_name',$username);
$name = ucwords($fn.' '.$ln); // Bob Jones
I want to display this $name
on my navigation.
Sending this $name
variable with every view would be a little over kill.
I'm seeking for a better way of doing this.
What should I do to make that variable accessible throughout my application routes/views ?
Restriction:
I don't have the access to the Auth::user
object.