Skip to content

Tell me, please, what kind of query can be used to get all records related to recursion? #247

Closed Answered by ilyapokrov
ilyapokrov asked this question in Q&A
Discussion options

You must be logged in to vote

@staudenmeir
I think I've figured it out. The following method works for me:
$allProducts = Category::find($category->category_id)->recursiveRoles()->get();
Instead of "$category->id" I indicated "$category->category_id".

Because I changed getLocalKeyName =)))

public function getLocalKeyName()
    {
        return 'category_id';
    }

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@staudenmeir
Comment options

@ilyapokrov
Comment options

@staudenmeir
Comment options

@ilyapokrov
Comment options

Answer selected by ilyapokrov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants