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 :
TrainerExport.php
<?php namespace App\Exports; use App\Models\Employee; use App\Models\Trainer; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; class TrainerExport implements FromCollection,WithHeadings { /** * @return \Illuminate\Support\Collection */ public function collection() { $data=Trainer::where('created_by', \Auth::user()->creatorId())->get(); foreach($data as $k=>$trainer) { $data[$k]["branch"]=!empty($trainer->branches)?$trainer->branches->name:''; $data[$k]["created_by"]=Employee::login_user($trainer->created_by); unset($trainer->created_at,$trainer->updated_at); } return $data; } public function headings(): array { return [ "ID", "Branch Name", "First Name", "Last Name", "Contact", "Email ID", "Address", "Experience", "Created By" ]; } }