mercredi 12 février 2020

How to send email verification for custom middleware in Laravel?

I have a custom middleware, say 'vendor'. I want to apply email verification for this middleware. So I make a new controller for that.

Vendor/Auth/VerificationController

I believe that I have to modify some functions in VerificationController like resend, verify and show. The problem is I don't know how to write the codes in it.

<?php
namespace App\Http\Controllers\Vendor\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\VerifiesEmails;

class VerificationController extends Controller
{
   use VerifiesEmails;

   protected $redirectTo = 'vendor/home';

   public function __construct()
   {
       $this->middleware('auth');
       $this->middleware('signed')->only('verify');
       $this->middleware('throttle:6,1')->only('verify', 'resend');
   }

   public function resend()
   {
      .....???
   }

   public function verify()
   {
      .....???
   }

   public function show()
   {
      ...???
   }
}

Anybody can pointing out for the solution?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2HfxSVR
via IFTTT

Aucun commentaire:

Enregistrer un commentaire