Skip to content

Commit

Permalink
Merge pull request #10 from DissNik/2.x
Browse files Browse the repository at this point in the history
chore: remove resolvePreview
  • Loading branch information
alexvenga authored Mar 6, 2024
2 parents 0234f55 + 55066d3 commit 117eeb4
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/Fields/MediaLibrary.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,6 @@ protected function prepareFill(array $raw = [], mixed $casted = null): mixed
return $value;
}

protected function resolvePreview(): View|string
{
if ($this->isRawMode()) {
return $this->isMultiple() ?
implode(';', $this->value->map(fn($media): string => $media->getFullUrl())->toArray())
: ($this->value?->getFullUrl() ?? '');
}

return view(
'moonshine::ui.image',
$this->isMultiple() ? [
'values' => $this->getFullPathValues(),
] : ['value' => current($this->getFullPathValues())]
);
}

public function getFullPathValues(): array
{
$values = $this->value;
Expand Down

0 comments on commit 117eeb4

Please sign in to comment.