Laravel 5.1. Delete the CSRF-tocken on certain routes



  • To date verification CSRF disconnected to kernel. However, this is not a good way for me to say the alternatives that have been realized. Laravel 5.1



  • Laravel 5.1♪ You can shut down the test ♪ CSRF- the current of a certain route by adding it (marchrut) to the field $except Total VerifyCsrfToken middleware:

    file - App\Htp\Middleware\VerifyCsrfToken.php

    <?php
    

    namespace App\Http\Middleware;

    use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;

    class VerifyCsrfToken extends BaseVerifier
    {
    /**
    * The URIs that should be excluded from CSRF verification.
    *
    * @var array
    /
    protected $except = [
    //тут прописываем маршруты которые хотим исключить
    'customRoute/
    ',
    ];
    }




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2