Level 17
Hi, don't we ask questions any more here in the forum :-)?
So let's start guessing... Perhaps it's your php version not understanding the fn syntax, have you tried to provide a closure this way:
return Role::with('permissions:id,name,description')
->withCount('users')
->when($this->getFilter('search'), function ($query, $term) {
return $query->search($term);
});
cheers krs
1 like