this is my scenario:
Laravel v5.5.44
maatwebsite/excel 3.1.3
I'm exporting a list of object using Maatwebsite Export classes. In my map() method all is working fine, but now I need to export images linked to my items. I've tried this way:
public function map($item):array
{
//....
$this->path = Storage::disk("artworks_images")->path($item->$key);
$this->drawings();
//...
}
Where my drawings method is:
public function drawings()
{
$drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing();
$drawing->setName('Cover');
$drawing->setDescription('Cover');
$drawing->setPath($this->path);
$drawing->setHeight(36);
$drawing->setCoordinates("A2");
return $drawing;
}
I've added the WithDrawings concern to the class.
It doesn't throw exceptions, but no images are shown.
Is there a correct way to use the drawings method in map()? (And, if it is possible, to auto-set the current coordinates like columns with primitives data?)