Calling modal from <a> tag
Is it possible to call a modal from an <a> tag?
This is the snippet of my code
30 Replies
Please don’t do this. Links and buttons are different for a reason. You can still use a button and make it look like a link.
Sure
I'll change it to button
You can either use an action or filament’s button component if you need more control. https://filamentphp.com/docs/3.x/support/blade-components/button
What do I do with
openNewUserModal
?That’s why I recommend using an action, the modal stuff is built in.
like similar to saveAction, deleteAction etc ?
Is it possible to update the ui ?

ahh nvm the only way i can update the Ui is through the function itself
You can always change the styling through css.
there is not function to let me style or use class here
Where should I do it?
The actions have css classes that you can use to target them in your stylesheet and change them.
like the theme.css ?
If you need to target a specific one, iirc correctly, you can use ->extraAttribute([‘class’ => ‘my-btn’]) then target .my-btn in the stylesheet.
Yes, like theme.css
It’s still all just html and css. 🙂
Yeah,, I was expecting to just use the extraAttribute function only
Well, technically you can as long as that file is part of the tailwind config content so it gets scanned.
Weird.. nothing works using extraAttribute
Ahh
Attributes plural. Sorry
do I need to add this to Tailwind.config ? like the GroupSetting.php?

:/ wasn't able to get it to work

Or at least the path to the directory where it is. But yes. If tailwind doesn’t know to scan those files it won’t include those classes.

Yeah added this just to make sure.
I have had issues in the past though with it scanning php class files. So, in that case just use a custom class name and target it in the css file and use tailwind’s @apply rule.
Yeah.. I guess . Thanks this will definitely solve the problem. Got no choice I guess..
Did you restart the dev server after adding it
Or run npm run build?
No
Just restarted it now but still doenst work
Any time you change the TW config you have to either restart or rebuild.
Okay noted on that
Surprised it’s not working though. Sorry.
Also, kinda guessing on your setup too.