⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
cms-1.dev-unit.com
/
core
/
app
/
Exports
/
View File Name :
EnrollExport.php
<?php namespace App\Exports; use App\BasicExtra; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; class EnrollExport implements FromCollection, WithHeadings, WithMapping { public $enrolls; public function __construct($enrolls) { $this->enrolls = $enrolls; } /** * @return \Illuminate\Support\Collection */ public function collection() { return $this->enrolls; } public function map($enroll): array { $bex = BasicExtra::firstOrFail(); return [ $enroll->order_number, $enroll->user ? $enroll->user->username : '-', $enroll->first_name ? $enroll->first_name : '-', $enroll->email, !empty($enroll->course) ? $enroll->course->title : '-', ($bex->base_currency_symbol_position == 'left' ? $bex->base_currency_symbol : '') . $enroll->current_price . ($bex->base_currency_symbol_position == 'right' ? $bex->base_currency_symbol : ''), $enroll->payment_method, $enroll->payment_status, $enroll->created_at ]; } public function headings(): array { return [ 'Order Number', 'Username', 'Name', 'Email', 'Course', 'Price', 'Gateway', 'Payment Status', 'Date' ]; } }