retrieve only identical array

Posted 3 months ago by Kareimovich

Hi, everybody, I need to get tasks that all tasktags names is in $TagArray but instead if one is in an array it gets I need to get id if all name is in $TagArray

$posts2 = Path::with(['pathtags' => function ($q) use ($TagArray) {
    $q->with(['Tasks'=>function($q) use ($TagArray) { 
         $q->has('tasktags', '=' , 2)->whereHas('tasktags', function ($query) use ($TagArray) {
            $query->whereIn('name' , $TagArray );
        })->with('tasktags');
    }]);
}])->first();

in example My Code Dose

name= [PHP,HTml5 ,Css3]

$TagArray = [PHP,HTml ,javascript ]

My Code Will return With the task

but I need to do this in one case

name= [PHP,HTml5 ,Css3]

$TagArray = [PHP,HTml ,javascript,Css3 ]

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

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.