���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
/
cutunix-shot
/
app
/
Exports
/
Viewing: OrderExportWithQuery.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 OrderExportWithQuery implements FromCollection, WithHeadings, WithEvents, ShouldAutoSize { /** * @return \Illuminate\Support\Collection */ public $orders; protected $resultCount; public $headings_array = [ 'height' => 'طول', 'width' => 'عرض', 'count_in_database' => 'تعداد در پایگاه داده', 'count_of_orders' => 'تعداد سفارشات' ]; public $modelCols = [ 'height', 'width' ]; public $cols = [ 'height', 'width' ]; public function __construct($orders) { $this->orders = $orders->select($this->modelCols)->get(); } public function headings(): array { return $this->headings_array; } public function collection() { $result = $this->orders; foreach ($result as $row) { $row['height'] = $row->height; $row['width'] = $row->width; $row['count_in_database'] = $row->getTotalCountOfThisSliceInTable(); $row['count_of_orders'] = $row->getCountOfOrdersThatCountainSliceWithOwnSize(); } $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