Files
freeu-project/app/Exports/UserProduct.php
Ritikesh yadav c661166e1d first commit
2024-03-28 14:52:40 +05:30

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;
}
}