|
|
@ -13,6 +13,7 @@ class WarehouseExport implements FromCollection, WithHeadings |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function collection() |
|
|
|
public function collection() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
$nomor = 1; |
|
|
|
// Ambil data dari model Peti |
|
|
|
// Ambil data dari model Peti |
|
|
|
$warehouses = m_warehouse::select( |
|
|
|
$warehouses = m_warehouse::select( |
|
|
|
'id', |
|
|
|
'id', |
|
|
@ -24,7 +25,7 @@ class WarehouseExport implements FromCollection, WithHeadings |
|
|
|
// Modifikasi data dan tambahkan nomor |
|
|
|
// Modifikasi data dan tambahkan nomor |
|
|
|
$data = $warehouses->map(function ($warehouse) use (&$nomor) { |
|
|
|
$data = $warehouses->map(function ($warehouse) use (&$nomor) { |
|
|
|
return [ |
|
|
|
return [ |
|
|
|
'No' => $warehouse->id, |
|
|
|
'No' => $nomor++, |
|
|
|
'Nama Gudang' => $warehouse->name, |
|
|
|
'Nama Gudang' => $warehouse->name, |
|
|
|
'Deskripsi' => $warehouse->description, |
|
|
|
'Deskripsi' => $warehouse->description, |
|
|
|
'Alamat' => $warehouse->address, |
|
|
|
'Alamat' => $warehouse->address, |
|
|
|