0
형 hasMany의()를 오프셋 오류 :Laravel은 불법는 내 코드가
Illegal offset type
Illuminate/Database/Eloquent/Relations/HasOneOrMany.php
$foreign = $this->getPlainForeignKey();
// First we will create a dictionary of models keyed by the foreign key of the
// relationship as this will allow us to quickly access all of the related
// models without having to do nested looping which will be quite slow.
foreach ($results as $result)
{
$dictionary[$result->{$foreign}][] = $result;
}
갱신
.sub_group
을 제거하면 오류를 반환하지 않습니다.
// works
$user = User::where('uid', $user_id)->with('groups')->firstOrFail();