skip to Main Content

I’m new to laravel and on learning stage at the moment.

My question is;
I’m trying to display ‘your email is verified’ after users verify their emails. Under profile page, I want the message to be displayed all the time, so users can see it is verified. I’m using jetstream

   @if (LaravelFortifyFeatures::enabled(LaravelFortifyFeatures::emailVerification()) && ! $this->user->hasVerifiedEmail())
            <p class="text-sm mt-2">
                {{ __('Your email address is unverified.') }}

I have attached a screenshot as well. Can anyone the pro-experts can have a moment to help me with this simple code?

Thanks in advance.
Screenshot of what I’m trying to do

I have tried adding into update-profile-information-form.blade.php but I’m getting errors, I assume I need an expert advice.

2

Answers


  1. Chosen as BEST ANSWER

    Ok I have figured out by writing the following code after checking the database for the email verified, and worked like a charm, simple and yet powerful.

    I hope it also helps to others who wants to do same.

       @if(Auth::user()->email_verified_at != null)
        verified 
        @else
          Not verified
      @endif
    

    Just add your own styling to it.


  2.      @if (auth()->user()->email_verified)
            <div class="alert alert-success" role="alert">
                Your email is verified permanently.
            </div>
        @else
            <div class="alert alert-warning" role="alert">
                Your email is not yet verified.
            </div>
        @endif
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search