Voyager: Many to Many relation Builder::getTranslationsOf() ErrorException

Created on 6 Mar 2018  路  7Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.4.36
  • Voyager Version: 1.0.15
  • PHP Version:5.6.30
  • Database Driver & Version:

Description:

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)

Steps To Reproduce:

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

Most helpful comment

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.

All 7 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

winex01 picture winex01  路  3Comments

TXRRNT picture TXRRNT  路  3Comments

MikadoInfo picture MikadoInfo  路  3Comments

iwasherefirst2 picture iwasherefirst2  路  3Comments

vaggelis2018 picture vaggelis2018  路  3Comments