mardi 3 mars 2020

Laravel 5.8 "Class 'App\Exports\Auth' not found"

I am trying to download records related to authenticated user using maatwebsite/excel and here is my export:

<?php

namespace App\Exports;

use App\User;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Maatwebsite\Excel\Concerns\FromCollection;

class UsersExport implements FromCollection
{
    /**
    * @return \Illuminate\Support\Collection
    */
    public function collection()
    {
        return Auth::user()->getrecs();
    }
}

but when I try to visit the route related to this export I get:

"Class 'App\Exports\Auth' not found"

how to solve this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire