<br />
<b>Warning</b>:  Undefined variable $auth in <b>/home/pevo0181/public_html/pia-soft.com/cleania/routes/index.php</b> on line <b>542</b><br />
<br />
<b>Warning</b>:  Trying to access array offset on value of type null in <b>/home/pevo0181/public_html/pia-soft.com/cleania/routes/index.php</b> on line <b>542</b><br />
<?php

namespace App\Exports;

use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithColumnWidths;


class UsagersExport implements FromCollection, WithHeadings, WithMapping,WithColumnWidths
{
    /**
    * @return \Illuminate\Support\Collection
    */
    protected $users;
    protected $key = 0;
    public function __construct($users)
    {
        $this->users = $users;
    }

    public function collection()
    {
        return $this->users;
    }

    public function headings(): array
    {
        return [
            'No',
            'Code',
            'Nom Complet',
            'Date_naissance',
            'Lieu_naissance',
            'Adresse',
            'No_telephone',
            'Nationalite',
            'Document',
            'No_document',
            'Date_register',
        ];
    }

    public function map($value): array
    {
        $this->key++;
        return [
            $this->key,
            $value->client_no,
            $value->client_name,
            $value->client_birth,
            $value->client_birth_adresse,
            $value->client_adresse,
            $value->client_phone,
            mb_strtoupper($value->client_nationality),
            $value->client_doc_name,
            $value->client_doc_id,
            $value->client_date,
       