Snapshot of main at 9f39a6e1e (2026-11-02)

This commit is contained in:
Ronald Huynen committed 2026-11-02 10:41:47 +01:00
commit 6ccf1792d7
2580 files changed
+1040202

No files matched your search

+63
View File
@@ -0,0 +1,63 @@
<?php
namespace App\Exports;
use Illuminate\Support\Collection;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithTitle;
class ProfileMessagesExport implements FromCollection, WithTitle, WithHeadings, WithMapping
{
use Exportable;
protected $data;
public function __construct(Collection $data)
{
$this->data = $data;
}
public function collection()
{
return $this->data;
}
public function headings(): array
{
return [
__('Conversation ID'),
__('Conversation type'),
__('Message ID'),
__('Date'),
__('Sender name'),
__('Sender type'),
__('Message'),
__('Reply to (ID)'),
];
}
public function map($message): array
{
$conversationType = $message['conversation_type'] ?? '';
$conversationType = $conversationType ? __(ucfirst($conversationType)) : '';
return [
$message['conversation_id'],
$conversationType,
$message['id'],
$message['created_at'],
$message['sender_name'] ?? '',
$message['sender_type'] ?? '',
$message['body'],
$message['reply_id'] ?? '',
];
}
public function title(): string
{
return __('Messages');
}
}