34 lines
730 B
PHP
34 lines
730 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Exports;
|
||
|
|
|
||
|
|
use App\Models\Admin\monthly_update_master;
|
||
|
|
use Maatwebsite\Excel\Concerns\Exportable;
|
||
|
|
use Maatwebsite\Excel\Concerns\FromCollection;
|
||
|
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||
|
|
|
||
|
|
class UserProductExport implements FromCollection, WithHeadings
|
||
|
|
{
|
||
|
|
// use Exportable;
|
||
|
|
/**
|
||
|
|
* @return \Illuminate\Support\Collection
|
||
|
|
*/
|
||
|
|
|
||
|
|
protected $data, $columns;
|
||
|
|
function __construct($data, $columns)
|
||
|
|
{
|
||
|
|
$this->data = $data;
|
||
|
|
$this->columns = $columns;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function collection()
|
||
|
|
{
|
||
|
|
// $data = monthly_update_master::select('')->get();
|
||
|
|
return $this->data;
|
||
|
|
}
|
||
|
|
public function headings(): array
|
||
|
|
{
|
||
|
|
return $this->columns;
|
||
|
|
}
|
||
|
|
}
|