Ordered entity permission roles by display name

Closes #2782
This commit is contained in:
Dan Brown
2021-06-04 22:36:30 +01:00
parent 807f92b693
commit bb00c331e4
2 changed files with 6 additions and 3 deletions

View File

@ -92,7 +92,7 @@ class Role extends Model implements Loggable
}
/**
* Get all visible roles
* Get all visible roles.
*/
public static function visible(): Collection
{
@ -104,7 +104,10 @@ class Role extends Model implements Loggable
*/
public static function restrictable(): Collection
{
return static::query()->where('system_name', '!=', 'admin')->get();
return static::query()
->where('system_name', '!=', 'admin')
->orderBy('display_name', 'asc')
->get();
}
/**