A
A
Artem00712018-04-21 12:13:46
excel
Artem0071, 2018-04-21 12:13:46

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.

And the documentation is not only blocked (I don’t know what it is connected with, but it only comes here through vpn), it’s also fragmentary and it’s not clear what should be taken and written out from where and where.
Here is an example of documentation:
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();
    }
}

The problem here is that there is no such ( Maatwebsite\Excel\Concerns\FromCollection ) directory
As a result, everything further simply does not make sense
And so in all examples
Can you advise what you use when exporting to excel?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Camaro67, 2018-04-21
@Artem0071

phpexcel

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question