1
0
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:
Alexander Skvortsov
2020-06-08 17:35:24 -04:00
committed by GitHub
parent 293e2251ca
commit 4da2994d1f
2 changed files with 15 additions and 22 deletions

View File

@@ -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.
*