Answer the question
In order to leave comments, you need to log in
How to find model instance in laravel eloquent if get returned 0 records?
Good afternoon.
It is necessary to find out the model instance after the selection if zero records were returned according to the conditions.
If at least 1 entry is returned, then you can easily take the class of the first value from the list. But if the selection did not return a single record, then it is impossible to understand which model was requested. Is there a possibility to do this? Maybe eloqent has some kind of dataProvider?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question