Support the ongoing development of Laravel.io →
Authentication Views Blade
Last updated 2 years ago.
0

try this:

{{{ isset(Auth::user()->name) ? Auth::user()->name : Auth::user()->email }}}
Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

When write a simple function or use a view composer.

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

This kind gentleman figured it out on twitter https://twitter.com/alesvaupotic/status/508723298726060032

Last updated 2 years ago.
0

**Hey mabasic **

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 }}

Last updated 7 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

mabasic mabasic Joined 3 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.