Файловый менеджер - Редактировать - /home/clickysoft/public_html/travel-guru.clickysoft.net/app/Exports/GraduationContributionSheet.php
Назад
<?php namespace App\Exports; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\FromQuery; use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithTitle; class GraduationContributionSheet implements FromCollection, WithTitle, WithHeadings { private $title; private $contributions; public function __construct($title, $contributions) { $this->title = $title; $this->contributions = $contributions; } public function title(): string { return $this->title; } public function query() { } public function headings() :array { return [ 'Order ID', 'Parent name', 'Parent email', 'Contribution amount', ]; } public function collection() { $finalData = []; foreach ($this->contributions as $datum){ $finalData[] = (object) [ 'order_id' => $datum['order_id'], 'customer_name' => $datum['customer_name'], 'customer_email' => $datum['customer_email'], 'contribution' => "$".number_format($datum['contribution'], 2), ]; } return collect($finalData); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка