add events to import

This commit is contained in:
hackerESQ
2024-08-29 22:26:04 -05:00
parent 62f3ca6ef1
commit 2febed20ae
4 changed files with 33 additions and 99 deletions
+15 -4
View File
@@ -4,18 +4,31 @@ namespace App\Imports;
use App\Imports\Sheets\SplitsSheet;
use App\Imports\Sheets\DividendsSheet;
use App\Imports\Sheets\DailyChangesSheet;
use App\Imports\Sheets\MarketDataSheet;
use App\Imports\Sheets\PortfoliosSheet;
use Maatwebsite\Excel\Events\AfterSheet;
use App\Imports\Sheets\DailyChangesSheet;
use App\Imports\Sheets\TransactionsSheet;
use Maatwebsite\Excel\Concerns\Importable;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
class BackupImport implements WithMultipleSheets
class BackupImport implements WithMultipleSheets, WithEvents
{
use Importable;
/**
* @return array
*/
public function registerEvents(): array
{
return [
// AfterSheet::class => dd('test')
];
}
public function sheets(): array
{
return [
@@ -23,7 +36,5 @@ class BackupImport implements WithMultipleSheets
'Transactions' => new TransactionsSheet,
'Daily Changes' => new DailyChangesSheet,
];
// Can listen for AfterSheet to run clean up afterwards
}
}