mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Import|Export
This commit is contained in:
parent
d115609d3c
commit
c0aa30ab58
@ -11,7 +11,28 @@
|
|||||||
|
|
||||||
namespace App\Export\CSV
|
namespace App\Export\CSV
|
||||||
|
|
||||||
|
use App\Models\Company;
|
||||||
|
|
||||||
class InvoiceExport
|
class InvoiceExport
|
||||||
{
|
{
|
||||||
|
private $company;
|
||||||
|
|
||||||
|
public function __construct(Company $company)
|
||||||
|
{
|
||||||
|
$this->company = $company;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function export()
|
||||||
|
{
|
||||||
|
$fileName = 'test.csv';
|
||||||
|
|
||||||
|
$data = $this->company->invoices->get();
|
||||||
|
|
||||||
|
return Excel::create($fileName, function ($excel) use ($data) {
|
||||||
|
$excel->sheet('', function ($sheet) use ($data) {
|
||||||
|
$sheet->loadView('export', $data);
|
||||||
|
});
|
||||||
|
})->download('csv');
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user