2017-09-18 4 views
0

내가 에 관계형 모델을 인출하려고하지만,이 경우 잘못된 무엇Laravel 바움 어떻게 관련하려면 모델() 메소드

$tree = \App\GroupDeprecator::where('id', $this->team_id)->with('lead')->first(); 
     dd($tree); //this one shows the user object 
     dd($tree->getAncestorsAndSelf());//this one does not shows the user object 

작동하지 않습니다 중첩 된 세트의 Laravels 바움 패키지를 사용하십니까?

답변

0

어떻게 해결 했습니까? 코드는 수동으로 데이터베이스에 업데이트되지 않는 한, 내가 할 것, 좋은 모양과 작동합니다 :

GroupDeprecator::rebuild(true) 

lft, rgt and depth 열을 업데이트 할