laravel-ardent / ardent

Self-validating, secure and smart models for Laravel's Eloquent ORM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement Ardent as a trait as well as a Model, so MongoDB can be used as well

igorsantos07 opened this issue · comments

It makes little sense to have Ardent as an optional improvement (as a trait), given it would poses confusion to developers if a model has Ardent improvements, and another one don't.

However, if you're not using a relational database, you're probably not extending Eloquent directly - you're using an extension that implements, say, NoSQL. Thus, Ardent cannot be extended at the same time. In these cases, Ardent makes sense being used as a Trait.

This would help users of Mongo + Ardent, that currently needs to reimplement some stuff: ardent-mongodb by @bmcmurray and laravel-mongo-ardent by @Fuitad, for instance.