Code Duplication    Length = 6-7 lines in 2 locations

app/Model/Traits/User/QueryTrait.php 1 location

@@ 73-79 (lines=7) @@
70
        return $this
71
            ->projects($status)
72
            ->with([
73
                'issues' => function (Relations\Relation $query) use ($status) {
74
                    $query->with('updatedBy');
75
                    $query->where('assigned_to', '=', $this->id);
76
                    if ($status === Project::STATUS_OPEN) {
77
                        $query->where('status', '=', Project\Issue::STATUS_OPEN);
78
                    }
79
                },
80
                'issues.user'          => function () {},
81
                'issues.countComments' => function () {},
82
            ]);

app/Model/Traits/Project/QueryTrait.php 1 location

@@ 155-160 (lines=6) @@
152
        }
153
154
        $query->with([
155
            'issues' => function (Relations\Relation $query) use ($status) {
156
                $query->with('updatedBy');
157
                if ($status === Project::STATUS_OPEN) {
158
                    $query->where('status', '=', Project\Issue::STATUS_OPEN);
159
                }
160
            },
161
            'issues.user' => function () {
162
            },
163
            'issues.countComments' => function () {