Benjamin W Benjamin W - 2 years ago 159
PHP Question

Laravel middleware verifyCsrfToken set url with variable

I have a papge require api to post

inside of my route setting is

Route::post('/commitmoney/{api}/{payment}', 'CommitmoneyController@post');


my problem is in my middleware verifyCsrfToken.php I couldn't set variable like below

protected $except = [
'/commitmoney/{api}/{payment}',


is anyone know how to solve this problem?

Answer Source

You have to the a * to make it work, instead of your named parameters:

protected $except = [
  '/commitmoney/*/*',
  ...
];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download