try this:
{{{ isset(Auth::user()->name) ? Auth::user()->name : Auth::user()->email }}}
okursan said:
try this:
{{{ isset(Auth::user()->name) ? Auth::user()->name : Auth::user()->email }}}
I am currently using that, but I want to use the above because it is much cleaner to look at.
When write a simple function or use a view composer.
psychonetic said:
When write a simple function or use a view composer.
I know how to get around this, but I am asking if anyone knows why does this not work? It is in the documentation, but it does not work.
This kind gentleman figured it out on twitter https://twitter.com/alesvaupotic/status/508723298726060032
it seem you have checked whether session has been set or not if you want to retrieve session just simply use For 1.Name : {{ Auth::user()->name }} 2.Email: {{ Auth::user()->email }}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community