snbhattacharjya / ppms

Polling Personnel Management System
1 stars 1 forks source link

Validate all Models before saving #14

Open abusalam opened 3 years ago

abusalam commented 3 years ago

Validation is very important it should be the primary thing to do when saving data not only when we get some data from unreliable sources (like http requests) even when the data generated from backend itself, no data should be considered valid and saved until it passes the validation rules.

abusalam commented 3 years ago

Use model events like saving creating etc via observers or listeners to validate data.