order tenancy menu

Working on multi-tenancy (https://filamentphp.com/docs/3.x/panels/tenancy#customizing-the-tenant-menu). The tenant menu in top left is ordering by ID on the table, how can I alter this so it orders alphabetically on the title?
1 Reply
Hightower
HightowerOP3mo ago
nvm, sussed it with the following in the Tenant model:
protected static function booted()
{
static::addGlobalScope('orderByTitle', function (Builder $builder) {
$builder->orderBy('name');
});
}
protected static function booted()
{
static::addGlobalScope('orderByTitle', function (Builder $builder) {
$builder->orderBy('name');
});
}
Want results from more Discord servers?
Add your server