You may try this:
$value="someName";
Project::with(['clients', 'tasks', 'status' => function($q) use($value) {
// Query the name field in status table
$q->where('name', '=', $value); // '=' is optional
}])
->where('status_id', '!=', '2')
->whereUserId(Auth::user()->id)
->get();
Also you may try this (It will fetch records only if the query returns name you want, otherwise none):
$value="someName";
Project::with(['clients', 'tasks', 'status'])
->whereHas('status', function($q) use($value) {
// Query the name field in status table
$q->where('name', '=', $value); // '=' is optional
})
->where('status_id', '!=', '2')
->whereUserId(Auth::user()->id)
->get();