diff --git a/src/BladeIconsServiceProvider.php b/src/BladeIconsServiceProvider.php index 877007c..79b1695 100644 --- a/src/BladeIconsServiceProvider.php +++ b/src/BladeIconsServiceProvider.php @@ -47,7 +47,7 @@ private function registerFactory(): void ); foreach ($config['sets'] ?? [] as $set => $options) { - if (! isset($options['disk'])) { + if (! isset($options['disk']) && ! $options['disk']) { $paths = $options['paths'] ?? $options['path'] ?? []; $options['paths'] = array_map( diff --git a/tests/FilesystemDiskTest.php b/tests/FilesystemDiskTest.php index cb24975..47464e3 100644 --- a/tests/FilesystemDiskTest.php +++ b/tests/FilesystemDiskTest.php @@ -4,6 +4,7 @@ namespace Tests; +use BladeUI\Icons\Factory; use BladeUI\Icons\Svg; class FilesystemDiskTest extends TestCase @@ -55,6 +56,17 @@ public function it_can_render_an_icon_component() $view->assertSee($expected, false); } + /** @test */ + public function the_local_filesystem_is_used_for_the_disk_option_with_an_empty_string() + { + $factory = $this->prepareSets([], ['default' => [ + 'disk' => '', + 'path' => $this->app->basePath('resources'), + ]]); + + $this->assertInstanceOf(Factory::class, $factory); + } + protected function getEnvironmentSetUp($app) { $app['config']->set('filesystems.disks.external-disk', [