Skip to content

Commit e5316b4

Browse files
authored
Use paths from object property, not local variable (#95)
Volt is already doing the work to save multiple component paths, we just need to use those saved paths when setting up the namespace. This provides support for easily adding paths to components in custom packages like: ```php use Illuminate\Support\ServiceProvider; use Livewire\Volt\Volt; class PackageServiceProvider extends ServiceProvider { /** * Bootstrap the application services. */ public function boot() { $this->app->booted( function() { Volt::mount( __DIR__.'/../resources/views/livewire' ); } ); } } ```
1 parent 8f4bbbd commit e5316b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MountedDirectories.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function mount(array|string $paths, array|string $uses = []): void
2929

3030
$this->paths = array_merge($this->paths, $paths->all());
3131

32-
View::replaceNamespace('volt-livewire', $paths->pluck('path')->all());
32+
View::replaceNamespace('volt-livewire', collect($this->paths)->pluck('path')->all());
3333
}
3434

3535
/**

0 commit comments

Comments
 (0)