No, I meant the $component variable: ```php ->action(function (Set $set, $arguments, Component $live

No, I meant the $component variable:
->action(function (Set $set, $arguments, Component $livewire, FileUpload $component) {
// this saves the file to livewire-tmp dir
$filePath = UrlUploadedFile::createFromUrl($imageLink)
  ->store('livewire-tmp', ['disk' => 'local']);

$filePath = explode('/', $filePath)[1];

// Creates a TemporaryUploadedFile instance for given filepath/file
$file = TemporaryUploadedFile::createFromLivewire($filePath);

$component->state($file);
// or [$file], not sure what it accepts
})
Was this page helpful?