You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
461 B
PHP

<?php
namespace App\Exports;
use App\Models\Siswa;
use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;
class SiswaExport implements FromView
{
/**
* @return \Illuminate\Support\Collection
*/
public function collection()
{
return Siswa::with('kelas')->get();
}
public function view(): View
{
return view('siswa.export', [
'siswa' => $this->collection()
]);
}
}