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

So I am creating an API but it has some caveats.

First off I have to be able to easily create models that DONT use eloquent because we are stuck with a legacy database and it is not always set up to be able to work with eloquent well.

Secondly and most importantly, while I will have base implementations of these models I will need to extend these models somehow to allow for custom client code. So, for example, I may have a base User model but also have a model for one of each of my clients that extend User (or an interface or whatever) and I will need to be able to set a config / binding / anything that will allow me to switch between which client I am currently working on.

I know this all seems very vague so feel free to ask any questions and I will clarify as much as I can.

Back Story: I am developing an app that will be used by multiple clients. Each of these clients will use the same tables but may process the data slightly different than the next client. I may have a calculation for one client that is totally different than the next. I would like to be able to give the client the ability to override any of the models without creating a whole new git repository for each client.

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.