Answer the question
In order to leave comments, you need to log in
How to disable csrf verification for post requests from third party resources in Laravel 5?
I have a task to implement a POST-reception on a site from 1C.
Opened a route to accept requests. In middleware/VerifyCsrfToken.php turned off verification for the required urls:
private $openRoutes = ['xml/desk/1', 'xml/desk/2'];
public function handle($request, Closure $next){
foreach($this->openRoutes as $route) {
if ($request->is($route)) {
return $next($request);
}
}
return parent::handle($request, $next);
}
Answer the question
In order to leave comments, you need to log in
It's most likely a misunderstanding here. Check if your handler enters, if the check works there, perhaps the original middleware is connected in another place, etc.
Put a break on the 46th line and you will understand everything from the trace.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question