4.x
support icon enums
#49
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces updates to the
HasIcon
trait insrc/Components/Concerns/HasIcon.php
to enhance flexibility by supportingBackedEnum
types for icons. The changes improve type safety and expand the range of values that can be used for icons and icon animations.Updates to
HasIcon
trait:Support for
BackedEnum
in icon definitions:BackedEnum
as a valid type for the$icon
property and theicon
method parameters. ([src/Components/Concerns/HasIcon.phpR5-R16](https://github.com/CodeWithDennis/filament-simple-alert/pull/49/files#diff-aa1d2065fa873adf077a76dc3cbf3e121746b94b5765731b9a6754c614867f6fR5-R16)
)Updated return type for
getIcon
method:getIcon
to includeBackedEnum
, allowing it to return either a string,BackedEnum
, ornull
. ([src/Components/Concerns/HasIcon.phpL28-R29](https://github.com/CodeWithDennis/filament-simple-alert/pull/49/files#diff-aa1d2065fa873adf077a76dc3cbf3e121746b94b5765731b9a6754c614867f6fL28-R29)
)