Skip to content

Commit 3728dd2

Browse files
committed
fix: image
1 parent 0ede7c3 commit 3728dd2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Commands/Refresh.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,7 @@ public function handle()
3333
$this->call('view:clear');
3434
$this->call('route:clear');
3535
$this->call('optimize');
36+
37+
return 0;
3638
}
3739
}

src/Fields/Image.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function resolveForShow($repository, $attribute = null)
1818
{
1919
parent::resolveForShow($repository, $attribute);
2020

21-
if (Storage::disk($this->getStorageDisk())->exists($this->value)) {
21+
if ($this->value && Storage::disk($this->getStorageDisk())->exists($this->value)) {
2222
$this->value = Storage::disk($this->getStorageDisk())->url($this->value);
2323
} else {
2424
$this->value = $this->resolveDefaultValue(app(RestifyRequest::class));
@@ -31,7 +31,7 @@ public function resolveForIndex($repository, $attribute = null)
3131
{
3232
parent::resolveForIndex($repository, $attribute);
3333

34-
if (Storage::disk($this->getStorageDisk())->exists($this->value)) {
34+
if ($this->value && Storage::disk($this->getStorageDisk())->exists($this->value)) {
3535
$this->value = Storage::disk($this->getStorageDisk())->url($this->value);
3636
} else {
3737
$this->value = $this->resolveDefaultValue(app(RestifyRequest::class));

0 commit comments

Comments
 (0)