Support the ongoing development of Laravel.io →
Authentication Database Mail

I'm new to laravel/webdevelopement in general, so i thought to start out i'd do a authentication script following a tutorial. In the actual tutorial I was shown to make content only shown to users who are logged. I did that with @if(Auth::check()) in my blade file.

Now im trying to make an "add email" button which is only shown to users who do not have an email registered.

I've tried to do that with: @if(isset(Auth::check()->email)) this doesn't give an error but simply doesn't check if users have an email(if i put an @else, it always shows the code of that) I also tried a bunch of stuff like @if(isset(Auth::check()->$user->email)) or @if(isset(Auth::check(User->$email))) but these all code syntax errors. I hope one of you knows the answer to this, thanks in advance!

Last updated 2 years ago.
0
@if(Auth::user()->email)
//user has email
@else
//no email
@endif

this should work.

0

thanks a lot!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.

© 2025 Laravel.io - All rights reserved.