Answer the question
In order to leave comments, you need to log in
Excel in Laravel?
I need to somehow display the lists from the database into excel files
But I can’t figure out how to do this.
I tried Maatwebsite , but either it was installed crookedly, or something else happened, but it works very badly
Already at the download stage it gives out:
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
class InvoicesExport implements FromCollection
{
public function __construct(InvoicesRepository $invoices)
{
$this->invoices = $invoices;
}
public function collection()
{
return $this->invoices->all();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question