Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS (Fork of MedicOneSystems/livewire-datatables but with updating dependencies and support new Laravel versions in time)
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 mi 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\ProyectoExports;
public function descargarExcel(Request $request)
{
$resultados = session('resultados');
return Excel::download(new ProyectoExports ($resultados), 'nombre_archivo.xlsx');
}
ProyectoExports.php
<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use Illuminate\Support\Collection;
class ProyectoExports implements FromCollection
{
/**
* @return \Illuminate\Support\Collection
*/
protected $resultados;
public function __construct(Collection $resultados)
{
$this->resultados = $resultados;
}
public function collection()
{
return $this->resultados;
}
}
already tried to use the command: compose dump-autoload
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 foundthis is mi code:
controller.php
ProyectoExports.php
already tried to use the command: compose dump-autoload