Throttle Password Reset

Published 3 months ago by jagdishabhiandroid

How can i add Throttle Password Reset in my reset controller?

Best Answer (As Selected By jagdishabhiandroid)
Yorki

You could accomplish this by adding throttle middleware like this

public function __construct()
{
    $this->middleware('guest');
    $this->middleware('throttle:1,60', ['except' => 'showLinkRequestForm']);
}
jagdishabhiandroid

this is my forgetpassword controller

jagdishabhiandroid
namespace App\Http\Controllers\Auth;

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

class ForgotPasswordController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Password Reset Controller
    |--------------------------------------------------------------------------
    |
    | This controller is responsible for handling password reset emails and
    | includes a trait which assists in sending these notifications from
    | your application to your users. Feel free to explore this trait.
    |
    */

    use SendsPasswordResetEmails;

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }
}

Yorki
Yorki
3 months ago (35,750 XP)

You could accomplish this by adding throttle middleware like this

public function __construct()
{
    $this->middleware('guest');
    $this->middleware('throttle:1,60', ['except' => 'showLinkRequestForm']);
}
jagdishabhiandroid

after adding this .

i have to change anything else?

Yorki
Yorki
3 months ago (35,750 XP)

No, should work without additional changes

jagdishabhiandroid

if i want to add this to my defuth auth login controller does it work same without make any changes

Please sign in or create an account to participate in this conversation.