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

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