Laravel-excel: [QUESTION] Export image in each row

Created on 1 Jul 2019  路  3Comments  路  Source: Maatwebsite/Laravel-Excel

Prerequisites

Versions

  • PHP version: "7.0.0"
  • Laravel version: 5.5.*
  • Package version: 3.1

Description


Hi. I want to export 1 or 2 image for each row .
I've tried view export with img tag but no picture added

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

I've tried

   public function registerEvents(): array
    {
        return [
            AfterSheet::class => function(AfterSheet $event) {
                $drawing = new Drawing();
                $drawing->setName('Logo');
                $drawing->setDescription('Logo');
                $drawing->setPath(public_path('/img/test.png'));
                $drawing->setCoordinates('H3');
                $drawing->setWorksheet($event->sheet->getDelegate());
            },
        ];
    }

and

    public function drawing($path)
    {
        $drawing = new Drawing();
        $drawing->setName('Logo');
        $drawing->setDescription('Logo');
        $drawing->setPath(public_path('/img/test.png'));
        $drawing->setHeight(90);
        return $drawing;
    }

they're not the thing i want and just added one picture on whole sheet. could anybody help me?

question

All 3 comments

Please try passing an array of Drawings to the drawing method and see if that works.

Tnx alot.that works.

Please try passing an array of Drawings to the drawing method and see if that works.

not working @GlennM

Was this page helpful?
0 / 5 - 0 ratings