Skip to content

Commit

Permalink
Merge pull request #444 from wout-o/3.x
Browse files Browse the repository at this point in the history
fix: Add error handling for team options when teams are not used
  • Loading branch information
bezhanSalleh authored Nov 10, 2024
2 parents 817db96 + d2f622f commit 7101118
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Resources/RoleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static function form(Form $form): Form
->placeholder(__('filament-shield::filament-shield.field.team.placeholder'))
/** @phpstan-ignore-next-line */
->default([Filament::getTenant()?->id])
->options(fn (): Arrayable => Utils::getTenantModel()::pluck('name', 'id'))
->options(fn (): Arrayable => Utils::getTenantModel() ? Utils::getTenantModel()::pluck('name', 'id') : collect())
->hidden(fn (): bool => ! static::shield()->isCentralApp() && Filament::hasTenancy())
->dehydrated(fn (): bool => ! static::shield()->isCentralApp() && Filament::hasTenancy()),

Expand Down

0 comments on commit 7101118

Please sign in to comment.