Linux server.jmdstrack.com 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
/ home/ jmdstrac/ public_html/ sabc/ app/ Exports/ |
|
<?php namespace App\Exports; use App\Position; use App\User; use Illuminate\Support\Facades\DB; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithCustomCsvSettings; class Info implements FromCollection, WithHeadings, WithCustomCsvSettings { /** * @return \Illuminate\Support\Collection */ public function collection() { $collect = collect(DB::table('reports') ->select('personFirstName','personLastName','type','startTime','stopTime','cost','duration','statut') ->orderBy('duration','desc') ->get()); return $collect; } public function headings(): array { return [ 'personFirstName', 'personLastName', 'type', 'startTime', 'stopTime', 'cost', 'duration', 'statut', ]; } public function getCsvSettings(): array { return [ 'delimiter' => ' ', 'enclosure' => '' ]; } }