Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

In the construct method of the default VerificationController.php of Laravel, I see:

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');
        $this->middleware('signed')->only('verify');
        $this->middleware('throttle:6,1')->only('verify', 'resend');
    }

What do these three middlewares do ?

question from:https://stackoverflow.com/questions/65598777/what-does-laravel-emailverification-controllers-contruct-method-do

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
191 views
Welcome To Ask or Share your Answers For Others

1 Answer

  1. auth middlware makes sure that user is logged in.
  2. singned is related to URL signing, which means attching encrypted data as query param more at: https://laravel.com/docs/8.x/urls#signed-urls
  3. throttle 6,1 means you can't make more than 6 request per minute.

Only means it is applied to only selected controller methods


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...