Closed robsontenorio closed 7 months ago
It won't work. You have to call volt::mount from your package's service provider to mount your package's livewire directory.
You will have to wrap it inside $this->app-> booted() or something like that to get it to happen after volt is mounted inside the main app, and merge in the existing mount paths. Something like this:
$voltPaths = collect(Volt::paths())->map(function ($path) {
return $path->path;
})->toArray();
$paths = array_merge($voltPaths, __DIR__. '/../resources/views/livewire');
Volt::mount($paths);
Sorry for any typos. On my phone.
Alternatively, you could direct those who use your package to add your package's directory paths to the call to volt::mount() in their volt service provider.
Thanks @inmanturbo
Currently there is no direction about how to develop a package using Volt component. Is it possible?
Using regular Livewire component it works.
And about Volt?