I cannot filter the contents of the groups
table against the username
in the users
table using Unwanted load limits
public function username() { return $this->belongsTo('User','fk_users_id')->select(['id','username']); }
I tried using the code below, but it only filters users
data, not groups
data
$groups = Groups::with(array('username' => function($query) use ($keyword) { $query->where('username', 'like', '%'.$keyword.'%'); })) ->where('status',1)->paginate($paginateValue);
any help is appreciated ...
source share