I'm here to ask you a question for my Laravel 9 project if it's possible please :) !
I made an authentication with a user table. There is a column where you can check if the user verified his/her email or not. If he/she does, there is a datetime. If not, the column is null.
I would like to make a div in the profile section where there is an information for the user about the verification. If the verification is done, green information with the message "Good your email is verified", if not there is a red information with "Email not verified".
I tried this but it doesn't work, it stays on "NOT VERIFIED" however there is a datetime in this session user.
Do you know why ? Or how can I fix it ? Thanks a lot !
CodePudding user response:
@if(Auth()->user()->isVerified)
<div style="color:green">Good email is verified</div>
@else
<div style="color:red">Email not verified</div>
@endif
CodePudding user response:
Please try using this
{{ auth()->user()->isVerified == null ? 'Not Verified' : 'Verified' }}