我正在尝试使用$q->pathtags->name
获取每个路径的标签名称,但出现错误。
$posts3 = Path::with(['ProgrammingField','pathtags' => function ($q) use ($AllPathsTasgs)
{$q->with(['Tasks' => function ($q)
{$q->has('tasktags', '=', 2)->orderBy('id', 'ASC')
->whereDoesntHave('tasktags',
function ($query) use ($q) {
$query->whereNotIn('name', $q->pathtags->name);
}
)
->with('tasktags')->orderBy('id', 'ASC');
}]);
}])
->whereIn('id', $pathId)->get();