Replies: 1 comment
-
I figured it out and took some work but got it to work the way I needed. Created a favoritesForm.php and a action-favorite.blade.php that used it. Then loaded it <livewire:account.action-favorite which='herb' :item_id='$herb->id' :key="$herb->id"/> It took some playing to get the key and wire:key set properly but once that fell into place works so very very slick. Really loving LIvewire. Took some |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I am wanting to implement a custom "favourite" option on my website.
I was thinking something like the Logout Action but I can't seem to make that work - so my alternative is to create a Form and a blade that calls it that I can then drop in where ever I need it.
It needs to be able to take 2 variables - what type of item they're favouriting and it's id. It would, ideally, be on the corner of each item that they can click on or off - it'll actually be check box/button style label that'll be green if it's on and not if it isn't.
My question - before I go down that route - is if that's the best option? I'm still learning all the tricks so I might have misses a better option.
Including, now that I think of it, trying to add it to every page that would be relevant etc - that'll just be a lot of redundant code that I'd rather not have to do.
Thank you in advance for any suggestions.
Beta Was this translation helpful? Give feedback.
All reactions