33 lines
799 B
PHP
33 lines
799 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 UserProduct implements FromCollection, WithHeadings
|
|
{
|
|
// use Exportable;
|
|
/**
|
|
* @return \Illuminate\Support\Collection
|
|
*/
|
|
|
|
protected $category;
|
|
protected $columns;
|
|
function __construct($category,$columns)
|
|
{
|
|
$this->category = $category;
|
|
$this->columns = $columns;
|
|
}
|
|
public function collection()
|
|
{
|
|
return monthly_update_master::select('custom_id')->whereIn('categories',$this->category)->where('holding_status','Holding')->get();
|
|
}
|
|
|
|
public function headings(): array {
|
|
return $this->columns;
|
|
}
|
|
}
|