mirror of
https://github.com/flarum/core.git
synced 2025-10-18 18:26:07 +02:00
lists > pluck
This commit is contained in:
@@ -650,7 +650,7 @@ class User extends AbstractModel
|
||||
// standard 'member' group, as well as any other groups they've been
|
||||
// assigned to.
|
||||
if ($this->is_activated) {
|
||||
$groupIds = array_merge($groupIds, [Group::MEMBER_ID], $this->groups->lists('id')->all());
|
||||
$groupIds = array_merge($groupIds, [Group::MEMBER_ID], $this->groups->pluck('id')->all());
|
||||
}
|
||||
|
||||
event(new PrepareUserGroups($this, $groupIds));
|
||||
@@ -665,7 +665,7 @@ class User extends AbstractModel
|
||||
*/
|
||||
public function getPermissions()
|
||||
{
|
||||
return $this->permissions()->lists('permission')->all();
|
||||
return $this->permissions()->pluck('permission')->all();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -94,7 +94,7 @@ class UserRepository
|
||||
->orderByRaw('username = ? desc', [$string])
|
||||
->orderByRaw('username like ? desc', [$string.'%']);
|
||||
|
||||
return $this->scopeVisibleTo($query, $actor)->lists('id');
|
||||
return $this->scopeVisibleTo($query, $actor)->pluck('id')->all();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user