While CustomerService.php class handles all customer creation logic and is consumed by CustomerController.php in both api and default module. Its easy to validate the values submitted by users in web using form. How can I validate the values submitted by users in service so that there is no code repetition in both front and api controllers for validation?
Code: Select all
Application modules default controller CustomerController.php [for web] api controllers CustomerController.php [for android device] services CustomerService.php