I looked at the documentation but couldn\'t find the answer there Suppose I have a custom route in web.php that gets to a controller function that returns a…