Created
October 1, 2025 13:03
-
-
Save codearachnid/f8d4b81fdcaac9ea793aef2aed88be25 to your computer and use it in GitHub Desktop.
FilamentPHP Toggle custom values for true/false
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * | |
| * This will use the true/false state within the field logic and set the custom values to pass to the model | |
| * | |
| */ | |
| Toggle::make('toggle')->dehydrateStateUsing(fn ($state): string => $state ? 'Y' : 'N'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment