<?php

namespace Eminiarts\Aura\Http\Controllers\Auth;

use Eminiarts\Aura\Http\Controllers\Controller;
use Eminiarts\Aura\Providers\RouteServiceProvider;
use Illuminate\Http\Request;

class EmailVerificationPromptController extends Controller
{
    /**
     * Display the email verification prompt.
     *
     * @return mixed
     */
    public function __invoke(Request $request)
    {
        return $request->user()->hasVerifiedEmail()
                    ? redirect()->intended(RouteServiceProvider::HOME)
                    : view('aura::auth.verify-email');
    }
}
