Nested Query Function

Posted 2 months ago by Kareimovich

Hi EveryBody i'm getting this error for my code here

Call to undefined method App\Tag::tasktags()

$TCompare = Path::with(['pathtags' => function ($q) use ($TagArray) { 
    $q->with(['Tasks'=>function($q) use ($TagArray) { 
        $q->has('tasktags', '=' , 2)->with('tasktags');
            $q->has('tasktags', '=' , 2)->whereIn('name', $TagArray)->with('tasktags');


return  $TCompare;

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.