Support the ongoing development of Laravel.io →
Security Eloquent Architecture

I'm learning DDD pattern and signle responsability and what not, and i found one thing that repeats a lot.

If i have UsersService, Repository or what ever, and when i am retriveing data from persistance layer (db) it's returns eloquent objects that can talk to db directly (without validation or anything). That isnt great...

So i was wondering how are you dealing with this problem? Or just leave it at is and hope that some new guy will not just update db directly?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

revati revati Joined 31 Jan 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.