One Hat Cyber Team
Your IP :
3.15.225.233
Server IP :
192.145.235.60
Server :
Linux ngx365.inmotionhosting.com 5.14.0-427.33.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 30 09:45:56 EDT 2024 x86_64
Server Software :
Apache
PHP Version :
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
centos12
/
bizcento.com
/
app
/
Exports
/
Edit File:
SalesReport.php
<?php namespace App\Exports; use Maatwebsite\Excel\Concerns\WithMapping; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\FromCollection; class SalesReport implements FromCollection, WithHeadings, WithMapping { public $orders; public function __construct($orders) { $this->orders = $orders; } /** * @return \Illuminate\Support\Collection */ public function collection() { return $this->orders; } public function map($order): array { return [ $order->order_number, $order->billing_fname, $order->billing_country_code . $order->billing_number, ($order->currency_symbol_position == 'left' ? $order->currency_symbol : '') . ' ' . $order->coupon . ($order->currency_symbol_position == 'right' ? $order->currency_symbol . ' ' : ''), ($order->currency_symbol_position == 'left' ? $order->currency_symbol : '') . $order->tax . ($order->currency_symbol_position == 'right' ? $order->currency_symbol : ''), !empty($order->shipping_charge) ? ($order->currency_symbol_position == 'left' ? $order->currency_symbol : '') . $order->shipping_charge . ($order->currency_symbol_position == 'right' ? $order->currency_symbol : '') : ($order->currency_symbol_position == 'left' ? $order->currency_symbol : '') . 0 . ($order->currency_symbol_position == 'right' ? $order->currency_symbol : ''), ($order->currency_symbol_position == 'left' ? $order->currency_symbol : '') . $order->total . ($order->currency_symbol_position == 'right' ? $order->currency_symbol : ''), str_replace('_', ' ', $order->serving_method), str_replace('_', ' ', $order->payment_status), str_replace('_', ' ', $order->order_status), str_replace('_', ' ', $order->completed), str_replace('_', ' ', $order->method), $order->created_at ]; } public function headings(): array { return [ 'Order Number', 'Name', 'Phone', 'Discount', 'Tax', 'Shipping Charge', 'Total', 'Serving Method', 'Payment', 'Status', 'completed', 'Gateway', 'Time', ]; } }
Simpan