Filament Drop-down menu

Hi all. I'm trying to implement a drop down menu in the title bar of my app. Filament 4, Laravel 12. I just want a drop down in the top right. The menu items are pulled from a table 'id', 'companyname'. I want the company name to form the items and when one is clicked, it updates a Session:: variable with the selected ID. By default the menu should display the name of the company in that session variable. Simple really. I found this: https://stackoverflow.com/questions/78821991/add-dropdown-element-to-laravel-filament-top-bar and it seems it suits my needs perfectly so I'm trying to get it working. Like a commenter says though, it's written for Filament 3.x and it won't directly work in 4. I've tried all manner of everything and I keep banging into the same thing as that poster. Component not found when making the selection in the drop down. It seems to do with the live() method. Remove that and it seems to work, but obviously I want it live! Is there a better way of doing what I want? If not, how do I get the referenced code working in 4.x? cheers
Stack Overflow
Add Dropdown element to Laravel Filament top bar
Hi Everyone, I'm working on a project with Laravel Filament and I'm looking to enhance the top bar by adding a dropdown field. Imagine a vibrant red rectangle at the top of the screen; that's where I
2 Replies
Dennis Koch
Dennis Koch3d ago
Sounds like you didn't register the Livewire component via Livewire::component() in a ServiceProvider
foggy
foggyOP2d ago
So.. the strangest thing .... I saw your comment and went to put everything back as it was in order to start troubleshooting based on your comment... and it just worked. DD popped up with the correct number. I can't see what I've done differently, I certainly haven't registered anything, it's just started working. Never mind, I'll take that as a win. So two questions: 1. How can I get the page to refresh after a selection? Currently, the livewire components (widgets) will update but the main table does not. 2. How can I get rid of / change the "select an option" text? 1. return redirect('/'); does what I need.

Did you find this page helpful?