mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Update HasFileAttachments.php
This commit is contained in:
@@ -8,6 +8,7 @@ use Illuminate\Contracts\Filesystem\Filesystem;
|
||||
use Illuminate\Filesystem\FilesystemAdapter;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use League\Flysystem\UnableToCheckFileExistence;
|
||||
use Livewire\Attributes\Renderless;
|
||||
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||
use Throwable;
|
||||
|
||||
@@ -38,6 +39,7 @@ trait HasFileAttachments
|
||||
}
|
||||
|
||||
#[ExposedLivewireMethod]
|
||||
#[Renderless]
|
||||
public function getUploadedFileAttachmentTemporaryUrl(TemporaryUploadedFile | string | null $attachment = null): ?string
|
||||
{
|
||||
return $this->getUploadedFileAttachment($attachment)?->temporaryUrl();
|
||||
@@ -77,6 +79,7 @@ trait HasFileAttachments
|
||||
}
|
||||
|
||||
#[ExposedLivewireMethod]
|
||||
#[Renderless]
|
||||
public function saveUploadedFileAttachmentAndGetUrl(): ?string
|
||||
{
|
||||
$attachment = $this->getUploadedFileAttachment();
|
||||
|
||||
Reference in New Issue
Block a user