%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/o91-api/app/Exports/
Upload File :
Create Path :
Current File : /var/www/html/o91-api/app/Exports/ContactApplicationsExport.php

<?php

namespace App\Exports;

use App\Models\ContactApplication;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;

class ContactApplicationsExport implements FromQuery, WithHeadings, WithMapping, ShouldAutoSize
{
    use Exportable;
    /**
     * @var
     */
    private $data;

    /**
     * ProtocolsExport constructor.
     *
     * @param $data
     */
    public function __construct($data)
    {
        $this->data = $data;
    }

    /**
     * @return array
     */
    public function headings(): array
    {
        return [
            'Name',
            'Anrede',
            'Vorname',
            'Nachname',
            'Strabe',
            'Hausnummer',
            'Plz',
            'Ort',
            'Bundesland',
            'Unternehmen',
            'Telephon',
            'Email',
            'Binein',
            'Anzahl',
            'Unternehmen',
            'Folgender',
            'Kapital',
        ];
    }

    /**
     * @return array
     * @var ContactApplication $contact
     */
    public function map($contact): array
    {
        return [
            $contact->name,
            $contact->anrede,
            $contact->vorname,
            $contact->nachname,
            $contact->strabe,
            $contact->hausnummer,
            $contact->plz,
            $contact->ort,
            $contact->bundesland,
            $contact->unternehmen,
            $contact->telephon,
            $contact->mail,
            $contact->binein,
            $contact->anzahl,
            $contact->unternehmen,
            $contact->folgender,
            $contact->kapital
        ];
    }

    public function query()
    {
        return $this->data;
    }

}

Zerion Mini Shell 1.0