jeudi 21 janvier 2021

Laravel Excel 3.1 - Generate excel without a model

I started to use laravel-excel in my Laravel project.
My problem is that do not use any specific model for the excel I need to generate, so I would like to avoid creating a dummy model class.

I found in the documentation this example:

(new Collection([[1, 2, 3], [1, 2, 3]]))->downloadExcel(
    $filePath,
    $writerType = null,
    $headings = false
)

However there is no more additional information.

In order to read an excel file with no model I found this solution:

$uploadedFiles = $request->file();
$res = Excel::toArray([], $uploadedFiles['file']);

But I do not find the parallel call for exporting.
Any help please?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire