Initial commit: Struktur aplikasi ilycats
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithTitle;
|
||||
|
||||
class MedicineTemplateExport implements FromCollection, WithHeadings, WithTitle
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
// Contoh data untuk user
|
||||
return collect([
|
||||
[
|
||||
'nama_obat' => 'Amoxicillin Syrup',
|
||||
'stok' => 10.5,
|
||||
'satuan' => 'ML',
|
||||
'kadaluarsa' => '2026-12-31'
|
||||
],
|
||||
[
|
||||
'nama_obat' => 'Drontal Cat',
|
||||
'stok' => 20,
|
||||
'satuan' => 'Tablet',
|
||||
'kadaluarsa' => '2027-05-20'
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return ['nama_obat', 'stok', 'satuan', 'kadaluarsa'];
|
||||
}
|
||||
|
||||
public function title(): string
|
||||
{
|
||||
return 'Template Import Obat';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user