Closed xfkrahmad closed 1 year ago
@xfkrahmad use the getFile()
method to get the file object to work with. With Spatie's media library package, it is as easy as -
// Single file
$product->addMedia(Filepond::field($request->image)->getFile())->usingName('...')->toMediaCollection('...');
// Multiple files
$images = Filepond::field($request->images)->getFile();
foreach ($images as $image) {
$product->addMedia($image)->usingName('...')->toMediaCollection('...');
}
@xfkrahmad use the
getFile()
method to get the file object to work with. With Spatie's media library package, it is as easy as -// Single file $product->addMedia(Filepond::field($request->image)->getFile())->usingName('...')->toMediaCollection('...'); // Multiple files $images = Filepond::field($request->images)->getFile(); foreach ($images as $image) { $product->addMedia($image)->usingName('...')->toMediaCollection('...'); }
thank you!!
I using a spatie media, so i need a string of the image path. for now i just do like on the screenshot, and i believe this is incorrect ways. thank for your response