Closed mohammed-elattar closed 7 years ago
the function name must match the field name
public function categoryId()
{
return $this->belongsToMany(Category::class);
}
From documentation: "Note: the method used for this relationship, must match the camelCase version of the row from the pages table. "
plus you don't need the "image_category" in the model. This is used to relationship 1-to-1, not 1-to-N (I think...) Voyager will store the relation in a pivot table, that will relate both tables, and it's usually the name of both tables combined (singular) So try to create a table with the name categorie_image with 2 columns only: image_id and category_id
Labels: question
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
I made all steps like in the documentation but i can't get multiple select field and these is the steps in pics , please help me to sort it out