How to access the data?
xfkrahmad opened this issue · 2 comments
xfkrahmad commented
rahulhaque commented
@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 commented
@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!!