0
내 ApiController을 가지고 생성자에서프랙탈 setRequestedScopes 정의되지 않은 메서드
$this->fractal = $fractal;
// Are we going to try and include embedded data?
$this->fractal->setRequestedScopes(explode(',', Input::get('embed')));
변압기
class PlaceTransformer extends TransformerAbstract
{
protected $availableEmbeds = [
'checkins'
];
public function transform(Place $place)
{
return [
...
];
}
public function embedCheckins(Place $place)
{
$checkins = $place->checkins;
return $this->collection($checkins, new CheckinTransformer);
}
내가
을 테스트하려고
나는 다음과 같은 오류를 정의되지 않은 메서드 리그 \ 프랙탈 \ 관리자
전화 : setRequestedScopes()를 얻을
퍼가기가 포함에 이름이 바뀐 작동합니다. 그래서 임베디드 대신에 include를 사용해야합니다. http://fractal.thephpleague.com/transformers/ 이름을 바꿀 때 코드가 정상적으로 작동한다고 생각합니다. – xAoc