Forms\Components\FileUpload::make('featured_image')->hintAction(
Filament\Forms\Components\Actions\Action::make('url_uploader')
->form([TextInput::make('url')->label('Image URL')])
->action(function (Set $set, Component $livewire, array $data) {
$filePath = UrlUploadedFile::createFromUrl($data['url'])
->store('livewire-tmp', ['disk' => 'local']);
$filePath = explode('/', $filePath)[1];
$file = TemporaryUploadedFile::createFromLivewire($filePath);
$set($livewire->mountedFormComponentActionsComponents[0], [$file], true);
}),
)
Forms\Components\FileUpload::make('featured_image')->hintAction(
Filament\Forms\Components\Actions\Action::make('url_uploader')
->form([TextInput::make('url')->label('Image URL')])
->action(function (Set $set, Component $livewire, array $data) {
$filePath = UrlUploadedFile::createFromUrl($data['url'])
->store('livewire-tmp', ['disk' => 'local']);
$filePath = explode('/', $filePath)[1];
$file = TemporaryUploadedFile::createFromLivewire($filePath);
$set($livewire->mountedFormComponentActionsComponents[0], [$file], true);
}),
)