HEX
Server: LiteSpeed
System: Linux s17244.fra1.stableserver.net 5.14.0-611.45.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 1 05:56:53 EDT 2026 x86_64
User: jubaroyal (1259)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /home/jubaroyal/public_html/app/Exports/ProductsExport.php
<?php

namespace App\Exports;

use App\Models\Product;
use Maatwebsite\Excel\Concerns\FromCollection;

class ProductsExport implements FromCollection
{
    /**
    * @return \Illuminate\Support\Collection
    */
    public function collection()
    {
        // return Product::all();
        return Product::select('name', 'supplier_id', 'shelf_id', 'store_id', 'category_id', 'code', 'purchase_date', 'expiry_date', 'purchase_price', 'selling_price', 'currency_id', 'status', 'created_at')->get(); // fields to be exported
    }
}