Class "app\Exports\ProyectoExport" not found

35 Views Asked by At

i got a variable with info i pull from a data base, and when i try to use the command: return Excel::download(new ProyectoExports ($resultados), 'nombre_archivo.xlsx'); i get the error: Class` "app\Exports\ProyectoExports" not found

this is my code

controller.php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use  Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Doctrine\DBAL\Driver;

use Maatwebsite\Excel\Facades\Excel;
use app\Exports\ResultadosExport;
use app\Exports\ProyectoExport;

public function descargarExcel(Request $request)
    {
      $resultados = session('resultados');
      return Excel::download(new ProyectoExports ($resultados), 'nombre_archivo.xlsx');   
    }

ProyectoExport.php

<?php

namespace App\Exports;


use Maatwebsite\Excel\Concerns\FromCollection;
use Illuminate\Support\Collection;

class ProyectoExport implements FromCollection
{
   /**
   * @return \Illuminate\Support\Collection
   */
   protected $resultados;

   public function __construct(Collection $resultados)
   {
       $this->resultados = $resultados;
   }

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

i tried uninstalling the maatwebsite and installing again, tried to use compose dump-autoload

0

There are 0 best solutions below