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
/
View File Name :
EventExport.php
<?php namespace App\Exports; use App\Models\Event; use App\Models\Branch; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; class EventExport implements FromCollection, WithHeadings { /** * @return \Illuminate\Support\Collection */ public function collection() { $data = Event::where('created_by', \Auth::user()->creatorId())->get(); foreach ($data as $k => $events) { $data[$k]["branch_id"] = Branch::where('id',$events->branch_id)->pluck('name')->first(); } return $data; } public function headings(): array { return [ "ID", "Branch Id", "Department Id", "Employee Id", "Title", "Start Date", "End Date", "Color", "Description", "Created By", "Created At", "Updated At", ]; } }