One Hat Cyber Team
Your IP :
216.73.216.55
Server IP :
5.189.175.239
Server :
Linux panel.gemx-ai.com 5.14.0-570.19.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 4 04:00:24 EDT 2025 x86_64
Server Software :
LiteSpeed
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
farmersapp
/
hrm.farmersapp.store
/
app
/
Exports
/
Edit File:
TimesheetReportExport.php
<?php namespace App\Exports; use App\Models\Employee; use App\Models\TimeSheet; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; class TimesheetReportExport implements FromCollection, WithHeadings { /** * @return \Illuminate\Support\Collection */ public function collection() { $data=TimeSheet::where('created_by', \Auth::user()->creatorId())->get(); foreach($data as $k=>$timesheet) { $data[$k]["employee_id"]=!empty($timesheet->employee) ? $timesheet->employee->name : ''; $data[$k]["created_by"]=Employee::login_user($timesheet->created_by); unset($timesheet->created_at,$timesheet->updated_at,$timesheet->created_by); } return $data; } public function headings(): array { return [ "ID", "Employee Name", "Date", "Hour", "Remark", ]; } }
Simpan