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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community