LaravelLaravel & VueJsVueJs

An approach to testing middleware

Laravel rockstar TJ Miller posted a short and sweet post how how he tested a middleware that forces requests to respond with JSON.

So what I’ve done here is define custom testing routes and applied the middleware as I would use it in the application routes, in this case global middleware and as middleware for the api group. This allows me to assert that the middleware is configured and functioning correctly.

Source link
★ READ ALSO ★  Inbound Email in Laravel - Laravel News

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.