create page tax with data, upload and export group by subdistrict
This commit is contained in:
23
app/Exports/TaxationsExport.php
Normal file
23
app/Exports/TaxationsExport.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use App\Models\Tax;
|
||||
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
|
||||
|
||||
class TaxationsExport implements WithMultipleSheets
|
||||
{
|
||||
public function sheets(): array
|
||||
{
|
||||
$sheets = [];
|
||||
|
||||
// Ambil semua subdistrict unik
|
||||
$subdistricts = Tax::select('subdistrict')->distinct()->pluck('subdistrict');
|
||||
|
||||
foreach ($subdistricts as $subdistrict) {
|
||||
$sheets[] = new TaxSubdistrictSheetExport($subdistrict);
|
||||
}
|
||||
|
||||
return $sheets;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user