leroy-merlin-br / mongolid-laravel

Easy, powerful and ultrafast MongoDB ODM for Laravel.
MIT License
240 stars 41 forks source link

Date Validation #166

Open ezandonai opened 1 year ago

ezandonai commented 1 year ago

The proposal is create a validation for date fields. Today the timestamp fields like created_at, updated_at are using BSON/UTCDateTime type. But if we want to create another field with date type, we don't have any rule to validate that UTCDateTime type. Even we don't have a transformer that receive a date and convert to UTCDateTime to save on mongo.

So the proposal here is that, create a validation type for dates and a way to convert the date before save.