Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

Anyone have input?

Last updated 2 years ago.
0

Define cross-project. Are you referring to keeping names consistent in the same project, or across multiple projects?

Either way seems like using constants is solving the wrong problem. If you're talking about the same project, you should be abstracting references to tables behind a repository, so you never need to define the correct table to use more than once. As far as field names, I guess you can define them all as constants, but it seems like you'd end up with this massive number of constant references that would lead to much more cognitive load than just remembering the correct field names.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

DB140141 db140141 Joined 19 Jun 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.

© 2024 Laravel.io - All rights reserved.