⚝
One Hat Cyber Team
⚝
Your IP:
172.22.0.1
Server IP:
151.80.20.34
Server:
Linux 794f04d97d5e 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
Server Software:
Apache/2.4.62 (Debian)
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
thread-self
/
root
/
var
/
www
/
html
/
app
/
Exports
/
View File Name :
CustomerExport.php
<?php namespace App\Exports; use App\Models\Customer; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\WithHeadings; class CustomerExport implements FromCollection, WithHeadings { /** * @return \Illuminate\Support\Collection */ public function collection() { $data = Customer::where('created_by', \Auth::user()->creatorId())->get(); foreach($data as $k => $customer) { unset($customer->id,$customer->password,$customer->avatar, $customer->tax_number,$customer->is_active, $customer->lang, $customer->created_by, $customer->email_verified_at, $customer->remember_token, $customer->created_at,$customer->updated_at); $data[$k]["customer_id"] = \Auth::user()->customerNumberFormat($customer->customer_id); $data[$k]["balance"] = \Auth::user()->priceFormat($customer->balance); // $data[$k]["avatar"] = !empty($customer->avatar) ? asset(\Storage::url('uploads/avatar')) . '/' . $customer->avatar : '-'; } return $data; } public function headings(): array { return [ "Customer No", "Name", "Email", "Contact", "Billing Name", "Billing Country", "Billing State", "Billing City", "Billing Phone", "Billing Zip", "Billing Address", "Shipping Name", "Shipping Country", "Shipping State", "Shipping City", "Shipping Phone", "Shipping Zip", "Shipping Address", "Balance", ]; } }