Loading…

How can we turn off CSRF protection for a particular route?

We can add that particular URL or Route in $except variable. It is present in the app\Http\Middleware\VerifyCsrfToken.php file.

 

Point to be noted: The question is mostly asked in Laravel Interview Questions. Read it twice and analyze the answers.

 

Example

                                        

class VerifyCsrfToken extends BaseVerifier {
      protected $except = [
            'Pass here your URL',
      ];
}

Suggest An Answer

No suggestions avaliable!

Latest post from Laravel Interview Questions

Ask Question