Many to Many relation
I got an issue when added many to many relationship
(2/2)聽ErrorExceptionCall to undefined method Illuminate\Database\Query\Builder::getTranslationsOf() (View: /Users/Grzegorz/Sites/laravel-codecreators/vendor/tcg/voyager/resources/views/posts/edit-add.blade.php)
make post table and model
make category table and model
create pivot tables
set relationship
And on my web I can see that post has many categories and category has many post
but when I try to edit post through voyager I get this error
(2/2)聽ErrorExceptionCall to undefined method Illuminate\Database\Query\Builder::getTranslationsOf() (View: /Users/Grzegorz/Sites/laravel-codecreators/vendor/tcg/voyager/resources/views/posts/edit-add.blade.php)
Any help would be appreciated
Greg
Thats probably because posts has custom views.
There is a PR where you can exclude built-in custom views, but thats not merged yet.
You can try to change the BREAD-slug to something different than posts or pages.
@emptynick Thank you!
Hi @emptynick
This issue has not been solved yet, I think. I still have this problem. Which PR is it?
Its https://github.com/the-control-group/voyager/pull/2117 but it wont solve the "problem".
The problem is the hardcoded view, which you can simply override (as mentioned in our docs).
You can just put something like this inside:
@include('voyager::bread.edit.add')
Closing this, as its not a bug.
I created a custom view to solve this but I thought the sidebar, the navbar and the other elements will be in that custom view but that is not happening, is there a way to use a custom view with including all these other sections?
@SoldierCorp, that is a different problem, most likely related to how you built your custom view. Please ask in slack or open your own issue with all relevant details, and we'll review there.
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.
Most helpful comment
Thats probably because
postshas custom views.There is a PR where you can exclude built-in custom views, but thats not merged yet.
You can try to change the BREAD-slug to something different than
postsorpages.