65 lines
1.4 KiB
PHP
65 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\User;
|
|
use App\Models\Sidang;
|
|
use Illuminate\Http\Request;
|
|
|
|
class PesertaSidangController extends Controller
|
|
{
|
|
/**
|
|
* Display a listing of the resource.
|
|
*/
|
|
public function index(Request $request)
|
|
{
|
|
$no = 1;
|
|
// Filter Tahun
|
|
$tahuns = Sidang::selectRaw('YEAR(created_at) as year')->groupBy('year')->pluck('year');
|
|
$tahun = $request->tahun;
|
|
|
|
// Tangani filter tahun
|
|
$sidangs = Sidang::whereIn(Sidang::raw('YEAR(created_at)'), $tahuns)
|
|
->when($tahun, function ($query, $tahun) {
|
|
return $query->whereYear('created_at', $tahun);
|
|
})
|
|
->with(['mahasiswa', 'pengajuan.dosenPembimbing']);
|
|
|
|
$sidangs = $sidangs->get();
|
|
|
|
return view('peserta-sidang', compact('no', 'tahun', 'tahuns', 'sidangs'));
|
|
}
|
|
|
|
/**
|
|
* Store a newly created resource in storage.
|
|
*/
|
|
public function store(Request $request)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Display the specified resource.
|
|
*/
|
|
public function show(string $id)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Update the specified resource in storage.
|
|
*/
|
|
public function update(Request $request, string $id)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Remove the specified resource from storage.
|
|
*/
|
|
public function destroy(string $id)
|
|
{
|
|
//
|
|
}
|
|
}
|