Sameer Dighe Sameer Dighe - 14 days ago 8
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.

Answer

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.)

Comments