Initial commit
This commit is contained in:
32
app/Exports/BlogImagesExport.php
Normal file
32
app/Exports/BlogImagesExport.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user