Search
 
SCRIPT & CODE EXAMPLE
 

PHP

VerifyEmailController in Api

<?php

namespace AppHttpControllers;

use IlluminateAuthEventsVerified;
use IlluminateHttpRedirectResponse;
use IlluminateHttpRequest;
use IlluminateRoutingController;
use AppModelsUser;

class VerifyEmailController extends Controller
{

    public function __invoke(Request $request): RedirectResponse
    {
        $user = User::find($request->route('id'));

        if ($user->hasVerifiedEmail()) {
            return redirect(env('FRONT_URL') . '/email/verify/already-success');
        }

        if ($user->markEmailAsVerified()) {
            event(new Verified($user));
        }

        return redirect(env('FRONT_URL') . '/email/verify/success');
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: cout post on category in controller laravel 
Php :: Search Multiple columns using one input 
Php :: send emails with runtime configurations in laravelk 
Php :: create json file in php and write n php 
Php :: singular from table laravel 
Php :: backend/web/index.php when deploying 
Php :: phpstorm entity identification 
Php :: How to add watermark in FPDF PHP - Parte 1 
Php :: laravel How can I escase string in whereRaw 
Php :: controller run 
Php :: divi layout injector shortcode module in function php file 
Php :: laravel get relation camelcase api 
Php :: First-class Callable Syntax - PHP 8.1 
Php :: Get Now Time In Persian Format JDF PHP Function 
Php :: customly add reviews from code site reviews wp 
Php :: php join array to parenthesis 
Php :: phoenix query builder 
Php :: @parent, @include, @show blade in laravel 
Php :: condition for both of one should be true laravel eloquent 
Php :: mysqli_fetch_all() expects parameter 1 to be mysqli_result, boolean given in C:xampphtdocscomplete-blog-phpadminincludespost_functions.php on line 31 
Php :: php Change the WooCommerce loop product link based on a custom field 
Php :: pakistan standard time zone 
Php :: multiply 
Php :: how to link a external modules using href in php 
Php :: Comment rediriger la page “Panier” et sauter la page Commande 
Php :: wordpress php get menu link page id 
Php :: magento 2 isSetFlag() 
Php :: Using Cookie Authentication 
Php :: how to convert array into json php 
Php :: tcpdf Array and string offset access syntax with curly braces is deprecated 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =