Catzie wrote a tutorial on how to create custom middleware to make a route group available only during testing.

custom middleware laravel

I needed to protect a group of routes from everything except my testing environment. PHPUnit tests that depend on certain routes were needed to be ruun, but I don't want those routes to be available anywhere else. I'll share in this tutorial what I did to protect the routes inside the group from all access aside from PHPUnit.

Complete code samples are at the source of this Laravel tutorial