I’ve image file upload to S3
:
class s3 extends Component
{
use WithFileUploads;
public $image;
public function save()
{
$this->validate(['image' => 'image']);
dispatch(new ImageUpload($this->image));
return 'success';
}
public function render()
{
return view('livewire.user.s3');
}
}
Job class:
class ImageUpload implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $image;
public function __construct($image)
{
$this->image = $image;
}
public function handle()
{
Storage::disk('s3')->put('uploads/product_images/', $this->image, 'public');
}
}
I got this error:
Exception
Serialization of 'Livewire\TemporaryUploadedFile' is not allowed