Skip to content

Commit

Permalink
Fix issue with empty disk
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Mar 31, 2021
1 parent 81fd797 commit 2505ea4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/BladeIconsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
12 changes: 12 additions & 0 deletions tests/FilesystemDiskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Tests;

use BladeUI\Icons\Factory;
use BladeUI\Icons\Svg;

class FilesystemDiskTest extends TestCase
Expand Down Expand Up @@ -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', [
Expand Down

0 comments on commit 2505ea4

Please sign in to comment.