mirror of
https://github.com/flarum/core.git
synced 2025-10-12 23:44:27 +02:00
Group Gambit Improvements (#2192)
* - Add ID to fields searched in group gambit - Use joins instead of looping in group gambit * Add visibility scoping to group gambit * call IDs userIds * If group identifier is numerical, treat it as an ID
This commit is contained in:
committed by
GitHub
parent
293e2251ca
commit
4da2994d1f
@@ -41,19 +41,6 @@ class GroupRepository
|
||||
return $this->scopeVisibleTo($query, $actor)->firstOrFail();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a group by name.
|
||||
*
|
||||
* @param string $name
|
||||
* @return User|null
|
||||
*/
|
||||
public function findByName($name, User $actor = null)
|
||||
{
|
||||
$query = Group::where('name_singular', $name)->orWhere('name_plural', $name);
|
||||
|
||||
return $this->scopeVisibleTo($query, $actor)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include records that are visible to a user.
|
||||
*
|
||||
|
Reference in New Issue
Block a user