While working with laravel, You feel like having a way to know whether a function you’ve just return works or not. In that case, you can have a separate controller to test your code without messing with your original code. For that you don’t even need to write a separate routes, as a single route will work for all of the test controller methods. Below is the way, for how to do that.