33 lines
586 B
PHP
33 lines
586 B
PHP
<?php
|
|
|
|
namespace App\Exports;
|
|
|
|
use Illuminate\Support\Collection;
|
|
use Maatwebsite\Excel\Concerns\FromCollection;
|
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
|
|
|
class BlogImagesExport implements FromCollection, WithHeadings
|
|
{
|
|
protected $data;
|
|
|
|
public function __construct(Collection $data)
|
|
{
|
|
$this->data = $data;
|
|
}
|
|
|
|
public function collection()
|
|
{
|
|
return $this->data;
|
|
}
|
|
|
|
public function headings(): array
|
|
{
|
|
return [
|
|
'Blog ID',
|
|
'Image Source',
|
|
'Width',
|
|
'Height',
|
|
];
|
|
}
|
|
}
|