MOON
Server: Apache
System: Linux host.sunshiene.com 4.18.0-553.121.1.el8_10.x86_64 #1 SMP Thu Apr 30 09:06:34 EDT 2026 x86_64
User: clientsoftwares (1005)
PHP: 8.2.31
Disabled: system, exec, mail, shell_exec, passthru, popen, proc_open, pcntl_exec, dl, ini_alter, ini_restore, symlink, link, chown, posix_kill
Upload Files
File: /home/clientsoftwares/public_html/stocky.clientsoftwares.com/app/Exports/LangExport.php
<?php

namespace App\Exports;

use App\Models\Translation;
use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\WithHeadings;

class LangExport implements FromCollection,  WithHeadings
{
    use Exportable;

    private $lang;

    public function __construct($langDetails)
    {
        $this->lang = $langDetails;
    }

    public function headings(): array
    {
        return [
            'lang_key',
            'group',
            'key',
            'value',
        ];
    }

    public function collection()
    {
        return Translation::join('langs', 'langs.id', '=', 'translations.lang_id')
            ->select(DB::raw('langs.key as lang_key'), 'translations.group', 'translations.key', 'translations.value')
            ->where('lang_id', $this->lang->id)
            ->get();
    }
}