I have a simple query that generates files using the maatwebsite
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use App\MyDB;
use Auth;
class ReportExport implements FromCollection
{
public function collection()
{
$email = Auth::user()->email;
return MyDB::MyFunction($email)
->select('Reference_Number')->get();
}
}
everything is working fine, but how can i add headers?
I tried looking at the documentation but it confused me more. https://laravel-excel.maatwebsite.nl/docs/3.0/export/mapping