I am unable to filter the contents of groups table with respect to username in users table using Eager Load Constraints
groups
username
users
Think it should be something like this:
Groups::with('User')->whereHas('User', function($q) use ($key){ $q->where('username', 'like', '%'.$key.'%'); })->where('status', 1)->paginate($pagVal);