2019-12-14 22:03:41 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Exports;
|
|
|
|
|
|
|
|
use App\Attendance;
|
|
|
|
use Maatwebsite\Excel\Concerns\FromView;
|
|
|
|
use Illuminate\Contracts\View\View;
|
|
|
|
|
|
|
|
class AttendanceExportView implements FromView
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return \Illuminate\Support\Collection
|
|
|
|
*/
|
|
|
|
private $classes_id;
|
|
|
|
|
|
|
|
public function __construct($classes_id)
|
|
|
|
{
|
|
|
|
$this->classes_id = $classes_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function view(): View
|
|
|
|
{
|
|
|
|
$attendances = Attendance::where('classes_id', $this->classes_id)->get();
|
2019-12-19 00:10:39 +01:00
|
|
|
return view('user.attendances_table_preview', ['attendances' => $attendances, 'export' => 1]);
|
2019-12-14 22:03:41 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|