Now that we have our CRUD operations, we should check that basic functionality works as expected. In this case, we want to ensure we correctly handle 404
errors. Let's look at the default way:
We can do better than this.
Correctly Handling 404 Error
We tried to load a category with the ID of 123
with our first test but got a long message. This was because we have APP_DEBUG=true
in our .env
file. We can change this to APP_DEBUG=false
to see what we would get in a production environment: