I suppose my question is, what has this to do with vue?
Why not just send what is required in the view from the controller. If no button is required, don't render it in blade.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm building a small forum app with Laravel and Vue and currently i'm adding filter buttons to fetch threads based on the filter button.
For example, in a Vue component, i have the following button, which essentially makes a get request to the back-end and fetches the threads created by the authenticated user
<a href="/threads?myThreads=1"> My Threads </a>
But in addition to the button above i have other filters as well
However, i want to hide the clicked buttons based on the query strings
window.location.href
For example if i click the button My Threads, then the href will be
/threads?=myThreads=1
In this case i want to hide the button My Threads, based on the href.
My question
Is this a bad approach ? To make decisions based on the href.
Should i try a different approach ? Such as, passing data from the backend to to front end
Please or to participate in this conversation.