Exception url in token Laravel?

1

In my project I need to release a url to a rest service that I'm implementing, but I'm not able to make the token exception for this route since I will not get it in the service.

In the VerifyCsrfToken file, you already have the $ except attribute for the route, but it is not helping:

protected $except = [
    'wallet/*'
];

Here's how routing is:

Route::post('wallet/apple/v1/devices/{device}/registrations/{registration}/{redNumber}', 'Service\AppleWalletController@register');

It still gives the same error when you run the service:

  

local.ERROR: exception 'Illuminate \ Session \ TokenMismatchException' in /var/www/dufryred.com.br/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:46

Is there another way to make this exception from token to my route, or do I have to configure it elsewhere?

    
asked by anonymous 03.05.2017 / 22:16

1 answer

2

I found a solution that worked. Here is the code for class VerifyCsrfToken :

class VerifyCsrfToken extends BaseVerifier {

/**
 * Handle an incoming request.
 *
 * @param  \Illuminate\Http\Request  $request
 * @param  \Closure  $next
 * @return mixed
 */
protected $excludeRoutes = [
    'wallet*'
];

public function handle($request, Closure $next)
{
    foreach( $this->excludeRoutes as $route )
    {
        if( $request->is( $route ) ) return $next($request);
    }
    return parent::handle($request, $next);
}

The route stayed the same.

    
03.05.2017 / 23:20