So I used the Livewire Surge project as a starting point for an initial project about two months ago (my first “real” Laravel and Livewire project).
Something I struggled with trying to add was the ability to add some little badges next to the left-hand sidebar menu items that would contain the count of items contained within that menu item.
For example, clicking on the “Work in Progress” menu item might display 70+ items and it would be nice to have a badge next to the menu item that would indicate how many are there (e.g. 74).
For the life of me though I’ve been struggling with understanding where I would need to add the needed variables for them to be seen properly.
I thought I should add the variables in to the app/View/Components/Layouts folder which contains a very barebones App Component Class, but if I add the variables there and try and call them from the resources/views/layouts/app.blade.php file I just get an error that the variable is not defined.
Has anybody else already figured this out or has more general Laravel/Livewire knowledge to point me in the right direction?