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!
@if(Auth::user()->email)
//user has email
@else
//no email
@endif
this should work.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community