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.
spp-paud/app/Exports/LaporanHarianExport.php

32 lines
705 B
PHTML

<?php
namespace App\Exports;
use App\Models\Transaksi;
use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;
class LaporanHarianExport implements FromView
{
public function __construct($date, $tanggal)
{
$this->date = $date;
$this->tanggal = $tanggal;
}
public function collection()
{
return Transaksi::orderBy('siswa_id','desc')->whereDate('created_at', $this->date)->get();
}
public function view(): View
{
return view('dashboard.export', [
'transaksi' => $this->collection(),
'date' => $this->date,
'tanggal' => $this->tanggal,
'jumlah' => 0
]);
}
}