Replies: 5 comments
-
I can’t figure out why the filter by category doesn’t work, what am I doing wrong |
Beta Was this translation helpful? Give feedback.
-
A couple of different things stand out:
public function expensesCategoryId($id)
{
return $this->where('expenses_category_id', $id);
} The public function expensesCategory($name)
{
return $this->related('expenseCategory', 'name', $name);
} |
Beta Was this translation helpful? Give feedback.
-
Tried two of your methods, still returns all records { Here is the code |
Beta Was this translation helpful? Give feedback.
-
I don't understand, method names should be like field names in the database |
Beta Was this translation helpful? Give feedback.
-
I'm sorry, I found a problem, the name of the method must match the parameters that I pass |
Beta Was this translation helpful? Give feedback.
-
Hello, I can't make a filter on the associated model. I have a category in my posts, that is, one post has one category, and categories can have many posts.
Tell me what I'm doing wrong
Model Record
Modal Category
RecordFilter
Beta Was this translation helpful? Give feedback.
All reactions