jeudi 7 septembre 2017

Laravel, can global/route middleware be disabled programatically?

I'd like to disable one or more 'pieces' of middleware (registered globally or on route) based on the request headers.

I'm using Postman to test my API but coming across the issue with CSRF protection as well as auth etc.

So ideally (probably in a Service Provider?) I'd check if the Postman Token was set in the request, along with the environment etc and then disabled certain middleware from being run.

Has anyone done anything like this before, can it be done etc?

Thanks!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire