Function in anonymous Laravel Blade component

46 views Asked by At

I'm working on a Laravel project and trying to create an anonymous Blade component that doesn't rely on a controller. I want this component to have a variable and a method that can be called within it to change the variable's state.

For instance, I have several links (like a navigation bar) and want to change the activeTab value when clicking a link.

However, I've noticed that Laravel always looks for the called function inside a controller. How can I change this behavior and implement the functionality I need directly within the anonymous Blade component?

0

There are 0 answers