[Feature Request]: Auto Completion for Livewire Components of a Module
Feature Description
Our application is organized into multiple modules, with each module registering its own Livewire components. These components are primarily registered via the Livewire facade using Livewire::component. For example, a module named Document registers a component like document.drafts.create. Given the large number of components, we implemented an auto-discovery mechanism to register all Livewire components within a specified directory or namespace, which avoids redundant code and ensures consistent naming.
Livewire::namespace(
directory: __DIR__ . '/Livewire',
namespace: 'Modules\\Document\\Livewire\\',
prefix: 'document'
);
It would be amazing if we get auto completion for these components. Additionally, it would be helpful if we could click on the Livewire tags in the template to navigate directly to their definitions.
Livewire::namespace is not a standard method?
I found a package that does the same - https://github.com/joserick/laravel-livewire-discover.
Honestly, I want to implement something useful for all users... So, there is no standard solution for namespaces yet?
Yep, it's not a standard method. However, the package does more or less the same thing. I absolutely agree with you that a solution is needed for all users, of course.
Maybe it is possible to build the auto-completion dynamically and depending on the components registered in the Livewire ComponentRegistry?