Skip to content

Commit

Permalink
Fix storing team_id as 0 if state is less or equal to 0 (#50)
Browse files Browse the repository at this point in the history
* Add role nagivation group customisation

* Add permission nagivation group customisation

* Add nagivation_section_group config option

* Remove default setting on Guard

Remove default setting on Guard because it causes an issue with the datalist being array if it's not selected / typed.

* Remove default setting on Guard

Remove default setting on Guard because it causes an issue with the datalist being array if it's not selected / typed.

* Add team support to RolesResource

* Add english language strings for team support

* Added Team Model Class linkage

* Add dehydrated state to the team_id to allow null when empty since 0 is an integer.

* Remove duplicated team_model from merging.

---------

Co-authored-by: Tony Partridge <[email protected]>
  • Loading branch information
tonypartridge and tonypartridger authored Jun 26, 2023
1 parent 9473340 commit ca28592
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Resources/RoleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public static function form(Form $form): Form
->options(
fn() => config('filament-spatie-roles-permissions.team_model', App\Models\Team::class)::pluck('name', 'id')
)
->dehydrated(fn($state) => (int) $state <= 0)
->placeholder(__('filament-spatie-roles-permissions::filament-spatie.select-team'))
->hint(__('filament-spatie-roles-permissions::filament-spatie.select-team-hint')),
])
Expand Down

0 comments on commit ca28592

Please sign in to comment.