One Hat Cyber Team
Your IP :
3.141.107.132
Server IP :
104.21.7.16
Server :
Linux server3.shared.spaceship.host 4.18.0-372.9.1.1.lve.el8.x86_64 #1 SMP Tue May 24 07:49:22 EDT 2022 x86_64
Server Software :
LiteSpeed
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
rlcugxuggt
/
web.dafriappsdev.com
/
app
/
Exports
/
Edit File:
EventBookingExport.php
<?php namespace App\Exports; use App\BasicExtra; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; class EventBookingExport implements FromCollection, WithHeadings, WithMapping { public $bookings; public function __construct($bookings) { $this->bookings = $bookings; } /** * @return \Illuminate\Support\Collection */ public function collection() { return $this->bookings; } public function map($booking): array { $bex = BasicExtra::firstOrFail(); return [ $booking->transaction_id, $booking->name, $booking->email, $booking->phone, !empty($booking->event) ? $booking->event->title : '-', ($bex->base_currency_symbol_position == 'left' ? $bex->base_currency_symbol : '') . $booking->amount . ($bex->base_currency_symbol_position == 'right' ? $bex->base_currency_symbol : ''), $booking->quantity, $booking->payment_method, $booking->status, $booking->created_at ]; } public function headings(): array { return [ 'Ticket ID', 'Name', 'Email', 'Phone', 'Event', 'Amount', 'Quantity', 'Gateway', 'Status', 'Date' ]; } }
Simpan