<?php

namespace App\Exports;

use App\Models\Mahasiswa;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;

class MahasiswaExport implements FromCollection, WithHeadings
{
    public function collection()
    {
        return Mahasiswa::all(['nim', 'nama', 'alamat', 'bagian', 'jurusan', 'jenjang_program']);
    }

    public function headings(): array
    {
        return ['NIM', 'Nama', 'Alamat', 'Bagian', 'Jurusan', 'Jenjang Program'];
    }
}
