Sameer Dighe Sameer Dighe - 5 months ago 44
PHP Question

Is it better idea to put data validations on client-side as well as server-side?

what I am trying to ask is , I am using Angular in client side and laravel Api in server side. so my question is, Is it better approach to put data validations on both side.


Yes. You should use both.

Client side - most validations are for the user inputs (e.g. invalid characters, regular expressions, etc.)

Server side - most validations are related to business logic (e.g. user authority, use privileges, etc.)