Answer the question
In order to leave comments, you need to log in
How to avoid conflict over method and field names in a table?
I noticed that if there is a table with a field for example field
Then if in the model for example model make a relation with a method called field and then get
$elements = Element::with('field')->orderBy('id','desc')->paginate(15);
Answer the question
In order to leave comments, you need to log in
I propose to add the name of the table to the field field, so that it turns out field_element. And in the template to access this variable.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question