���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
repositories
/
portal-cutunix
/
app
/
Exports
/
Viewing: UserExportWithQuery.php
<?php namespace App\Exports; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\ShouldAutoSize; use Maatwebsite\Excel\Concerns\WithEvents; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Events\AfterSheet; use Morilog\Jalali\Jalalian; class UserExportWithQuery implements FromCollection, WithHeadings, WithEvents, ShouldAutoSize { /** * @return \Illuminate\Support\Collection */ public $users; protected $resultCount; public $headings_array = [ 'id' => 'شناسه', 'platform' => 'پلتفرم', 'mobile' => 'موبایل', 'first_name' => 'نام', 'last_name' => 'نام خانوادگی', 'job' => 'شغل', 'payment' => 'پرداختی', // 'marketer' => 'بازاریابی', 'state_id' => 'استان', 'city_id' => 'شهر', 'expire_date' => 'انقضای حساب', 'created_at' => 'ثبت نام', ]; public $modelCols = [ 'id', 'platform', 'mobile', 'first_name', 'last_name', 'job', 'payment', 'state_id', 'city_id', 'expire_date', 'created_at', ]; public $cols = [ 'id', 'platform', 'mobile', 'first_name', 'last_name', 'job', 'payment', 'state_id', 'city_id', 'expire_date', 'created_at', ]; public function __construct($users) { $this->users = $users->select($this->modelCols)->get(); } public function headings(): array { return $this->headings_array; } public function collection() { $result = $this->users; foreach ($result as $row) { $row['id'] = $row->id; $row['platform'] = $row->platform; $row['mobile'] = $row->mobile; $row['first_name'] = $row->first_name; $row['last_name'] = $row->last_name; $row['job'] = $row->job; // $row['address'] = $row->address; $row['payment'] = ($row->transactions()->count() > 0 && $row->has_any_success_payment ? 'پرداختی دارد. ' : 'پرداختی ندارد. ') . '|' . ($row->marketer != null ? 'استفاده از کد دارد.' : 'استفاده از کد ندارد.'); $row['state_id'] = $row->state?->state ?? 'ثبت نشده'; $row['city_id'] = $row->city?->city ?? 'ثبت نشده'; $row['expire_date'] = Jalalian::forge($row->expire_date)->format('Y/m/d'); $row['created_at'] = Jalalian::forge($row->created_at->format('Y-m-d'))->format('Y/m/d H:i:s'); } $this->resultCount = count($result) + 1; return $result; } public function registerEvents(): array { $styleArray = ['font' => ['bold' => true]]; return [ AfterSheet::class => function (AfterSheet $event) use ($styleArray) { // bold heading $event->sheet->getStyle("A1:BJ{$this->resultCount}") ->applyFromArray($styleArray); // change direction to rtl $event->sheet->setRightToLeft(true); // center all text $event->sheet ->getStyle("A1:BJ{$this->resultCount}") ->getAlignment()->setHorizontal('center'); }, ]; } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa