Custom Action that displays modal that contains a value to only be copyable? Help..

I want to create something like this so that I do not have to use a custom component which is currently used.. How would this be properly done? Would I use a form attatched to an action or what?
20 Replies
awcodes
awcodes2y ago
Sure, just make the input readonly with the extraInputAttributes() method. And just make your description text the label.
Andrew Wallo
Andrew WalloOP2y ago
But doesn't the value have to be in a form and doesn't it have to come from the database? It can't come from database because the value is hashed by then
awcodes
awcodes2y ago
You can just set the state of the input.
Andrew Wallo
Andrew WalloOP2y ago
Can you give me an example of that? I have to do Field::make('something') though right?
awcodes
awcodes2y ago
That’s for page actions, but they all have the mountUsing() method.
Andrew Wallo
Andrew WalloOP2y ago
Thank you will try Yeah I don't think this is possible with my use case unfortunately.. but thanks
awcodes
awcodes2y ago
I willing to bet it is. On my phone at the moment, but if you haven’t figured it out I’ll try to write it tomorrow.
Andrew Wallo
Andrew WalloOP2y ago
I will put the PHP class in here. If you can I would be surprised I might have to send pictures though because the class is close to 300 lines long
awcodes
awcodes2y ago
Just put it in a private gist and send it to me through Pm.
Andrew Wallo
Andrew WalloOP2y ago
Can I do that if the code isn't committed? Actually I'm gonna go ahead an commit it as is right now because I like it, but then you can look at it through github
awcodes
awcodes2y ago
Ok. But yes. A gist is just arbitrary code. So you’d just copy paste into the gist.
Andrew Wallo
Andrew WalloOP2y ago
You might have to download in order to understand but idk... its up to you Again I appreciate it and just let me know
awcodes
awcodes2y ago
Just so I’m following, getActions is where you’re trying to execute this?
Andrew Wallo
Andrew WalloOP2y ago
Its where the
$this->displayTokenValue()
$this->displayTokenValue()
is in the create action, right after create it instantly opens a custom modal in the corresponding blade view to show the api token
awcodes
awcodes2y ago
Yea. That’s where I was looking just wanted to make sure I was focusing on the right thing. Will let you know.
Andrew Wallo
Andrew WalloOP2y ago
Doesn't have to be right this instant, I'm on your time. Your the one doing me a favor here, thanks again
awcodes
awcodes2y ago
Won’t be this instant. I’m in Friday Jameson mode. But will look more tomorrow. 😂
Andrew Wallo
Andrew WalloOP2y ago
Whatever gets the job done hahaha
Want results from more Discord servers?
Add your server