Like Count updating in Blade view only after 2 clicks #201
Unanswered
amarokcreative
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all, new to Laravel and just starting using Livewire and I'm having an issue with a button click that should register a new like (using the Laravel Love package) and then update the count variable accordingly in the blade template. The code is 90% of the way there but the issue i'm having is when I click the button that calls the hype() function nothing is updated in the view until I click it a second time. However, when i check the database after 1 click the value has been updated correctly. Then on subsequent clicks the variable in the view is always 1 off from what's in the database.
Any idea what could be happening here? Any help or guidance is much appreciated.
Here is the blade view
Here is most of the Controller
Beta Was this translation helpful? Give feedback.
All reactions