Hint Action - Copy value
I wanna add a hint action to a
Builder
field, which should copy the $state into the browser clipboard.
This is what I got so far:
This already show the button and on click it dd
's the json of the Builder
field state. But how to copy the value to clipboard, instead of dd
ing? How can I call JS navigator.clipboard.writeText(copyText.value);
?
Just to understand, what I wanna achieve: Later I will change it to
so that I can import/export the Builder value.Solution:Jump to solution
Try this plugin.
https://github.com/webbingbrasil/filament-copyactions
If you need a one off simple solution, you may take some inspiration from this trait from above package
https://github.com/webbingbrasil/filament-copyactions/blob/3.x/src%2FConcerns%2FHasCopyable.php...
GitHub
GitHub - webbingbrasil/filament-copyactions: A easy-to-use copy act...
A easy-to-use copy actions for Filament Admin Pages, Tables and Form Fields. - webbingbrasil/filament-copyactions
GitHub
filament-copyactions/src/Concerns/HasCopyable.php at 3.x · webbingb...
A easy-to-use copy actions for Filament Admin Pages, Tables and Form Fields. - webbingbrasil/filament-copyactions
1 Reply
Solution
Try this plugin.
https://github.com/webbingbrasil/filament-copyactions
If you need a one off simple solution, you may take some inspiration from this trait from above package
https://github.com/webbingbrasil/filament-copyactions/blob/3.x/src%2FConcerns%2FHasCopyable.php
GitHub
GitHub - webbingbrasil/filament-copyactions: A easy-to-use copy act...
A easy-to-use copy actions for Filament Admin Pages, Tables and Form Fields. - webbingbrasil/filament-copyactions
GitHub
filament-copyactions/src/Concerns/HasCopyable.php at 3.x · webbingb...
A easy-to-use copy actions for Filament Admin Pages, Tables and Form Fields. - webbingbrasil/filament-copyactions