return view is returning different data

Posted 2 months ago by Kareimovich

Hi, everybody, My code here is returning tasks that have more than 1 Tag and task tags are in $TagArray everything is working good in

   return $TaskData;

but When I pass TaskData into view I get different results even get Tasks with one tag

        return view ('task',compact('TaskData'));

My Code

$TaskData= Path::with(['pathtags' => function ($q) use ($TagArray) {
$q->with(['Tasks'=>function($q) use ($TagArray) { 
    $q->has('tasktags', '=' , 2)->whereDoesntHave ('tasktags', function ($query) use     
     ($TagArray) {


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.