N
N
NubasLol2019-06-18 13:31:11
Laravel
NubasLol, 2019-06-18 13:31:11

How to make a request that does not apply to a specific model?

Is there some kind of pseudo model in the lark, for requests, with a custom "from"?
That is, I want to make a request by changing from. Now I do it simply with any model, but I don't really like it. A simple builder is not suitable, since it is the Eloquent model that is needed

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin B., 2019-06-18
@NubasLol

If you are not satisfied with Query Bulder and need some model properties, then you need to create a model for your table. There are no other options and, for logical reasons, there cannot be. In any case, all your crutches will lead you to the only correct path - creating a model.
There is a second option, this is that you don’t scratch us weakly and don’t say a lot in your question, you need to voice everything why and why, and then, perhaps, the answer may take on a completely different color

V
Vyacheslav Plisko, 2019-06-18
@AmdY

The value for from is taken from the $table attribute, so models have setTable and getTable methods.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question