livewire / volt

Volt is an elegantly crafted functional API for Livewire.
https://livewire.laravel.com/docs/volt
MIT License
312 stars 19 forks source link

Support for Volt components in non-default locations #94

Closed bookwyrm closed 4 months ago

bookwyrm commented 4 months ago

I'm working on a private, custom package and I'd like to be able to ship a Volt component in the package.

I can use Livewire\Volt\MountedDirectories->mount() to add my local views/livewire directory but since mount() uses View::replaceNamespace() there is no persistent way to tell Volt about my views directory.

Can the code use View::addNamespace() instead or provide some other means of adding additional directories to be used when looking for a Volt view file?

bookwyrm commented 4 months ago

I think that a switch from replaceNamespace to addNameSpace would address #87

bookwyrm commented 4 months ago

After looking at the code more, I think that #95 is a better solution

driesvints commented 4 months ago

Looks like you already sent in a PR so let's see how that goes. Thanks