In laravel 5.2 I want to disable CSRF on a route, since I am using pagseguro (michaeldouglas / laravel-pagseguro) and want to work with automatic return.
I have tried to add the route in the exception array in the App \ Http \ MiddlewareVerifyCsrfToken
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
class VerifyCsrfToken extends BaseVerifier{
protected $except = [
'pagseguro/notification',
];
}
I have tried to delete and comment the VerifyCsrfToken in App \ Http \ kernel.php
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
//\App\Http\Middleware\VerifyCsrfToken::class,
],
None of the methods worked, I keep getting the error below:
MethodNotAllowedHttpException in RouteCollection.php line 219