Is there a way to alias a component that's not in the App\Http\Livewire namespace?

The structure of my project is a bit different where the components are not in the App\Http\Livewire namespace so i’m having to do <livewire:App\Domains\My\Other\Component::class> and it’s really ugly looking. Is there a way to alias the component namespace to the name so I can continue to use <livewire:my-component>?

Did you publish the config? You should be able to modify there.

Yeah it looks like there can only be one namespace. Basically by design I would have the components organized in different areas of the project files, but it looks like that have to be in one directory correct? So i’ll just leave them all in App/Http/Livewire.

There’s probably much better way than this…

The manifest is stored \bootstrap\cache\livewire-components.php that I think you could overwrite. If I’m not wrong on that, the headache of this is every time you create a new component or run livewire:discover, that file is going to be overwritten and you will have to change it again.

Hi,

@Rappasoft is right it’s not obvious to change this when you have structured your app by Modules for instance.
We have this package which explains how we could do. I try on a Module (package Nwidart without success)

If you have a solution :wink: