Files
investbrain/app/Imports/BackupImport.php
T

38 lines
941 B
PHP
Raw Normal View History

2024-08-07 18:29:23 -05:00
<?php
namespace App\Imports;
use App\Imports\Sheets\PortfoliosSheet;
2024-08-29 22:26:04 -05:00
use App\Imports\Sheets\DailyChangesSheet;
2024-08-07 18:29:23 -05:00
use App\Imports\Sheets\TransactionsSheet;
use Maatwebsite\Excel\Concerns\Importable;
2024-08-29 22:26:04 -05:00
use Maatwebsite\Excel\Concerns\WithEvents;
2024-08-07 18:29:23 -05:00
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
2024-08-29 22:26:04 -05:00
class BackupImport implements WithMultipleSheets, WithEvents
2024-08-07 18:29:23 -05:00
{
use Importable;
2024-08-29 22:26:04 -05:00
/**
* @return array
*/
public function registerEvents(): array
{
return [
2024-08-30 20:22:28 -05:00
// BeforeSheet::class => DB::commit(),
2024-08-29 23:36:44 -05:00
// AfterSheet::class => Artisan::queue(RefreshHoldingData::class),
2024-08-30 20:22:28 -05:00
// AfterSheet::class => Artisan::call(RefreshHoldingData::class)
2024-08-29 22:26:04 -05:00
];
}
2024-08-07 18:29:23 -05:00
public function sheets(): array
{
return [
'Portfolios' => new PortfoliosSheet,
2024-08-28 22:06:47 -05:00
'Transactions' => new TransactionsSheet,
2024-08-29 21:39:59 -05:00
'Daily Changes' => new DailyChangesSheet,
2024-08-07 18:29:23 -05:00
];
}
}