Copyable value with formatStateUsing function

I am trying to add a copyable option to a table column, but the value for it is changed using formatStateUsing function. Is there a way to change the value of that is being copied?
7 Replies
toeknee
toeknee2y ago
I don't quite follow, can you explain a bit more please?
LeandroFerreira
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
ciorici
cioriciOP2y ago
This is the code I am referring to.
ciorici
cioriciOP2y ago
instead of copying the value it gets the ID that is saved in the database
Thijmen
Thijmen2y ago
The find method searches on the primaryKey of the model. I don't think $state is the primaryKey. So better to replace it with a basic where statement.
Dennis Koch
Dennis Koch2y ago
->copyable() doesn't have options to modify the content. Maybe try getStateUsing() instead of formatStateUsing() to set the state and not only the formatting
ciorici
cioriciOP2y ago
thanks, that worked!
Want results from more Discord servers?
Add your server