#Some questions about Eloquent and Model Relationships

3 messages · Page 1 of 1 (latest)

mortal coral
#

Hey, so I recently got more into Laravel and I am a bit lost with all the Models and the Relationships between them..

I have a query which is kinda big with some casts and sum and all that. Right now I have all the tables I made as models with their properties and such. But the way I am querying them is calling a ::query() function on the first table the query is querying but then I am just kinda using ->select() and ->havingRaw() on the query builder.

My question is is that ok? Or should I setup all neede relationships so that I can just use the ->with() on the query

#

I don't know if this even makes any sense but I feel like I am missing out on so much stuff eloquent has to offer

tepid patio
#

Giving more specific info will help