DEV Community


Discussion on: Laravel Service Classes Explained

mellamoadan profile image
Adan ϟ

This is awesome, thanks for sharing.

Something that I didn't see in the example is that the service shouldn't hold anything related with the request and response. If we want to validate the request input, we can do it in a request class. If there is something wrong inside the service method, we should let the controller know so the right http code can be thrown.

fhsinchy profile image
Farhan Hasin Chowdhury Author

That just flew under the radar mate. If you look at the code examples, you'll see that I've used a request classes myself. It's just that I'm so used to using request classes, I completely forgot to mention them in the article. I'll update the article ASAP. 😊