- Added a new column to display open semesters in the academic terms table with badges. - Removed course registration related pages and components including index, create, and show. - Updated course registration types to reflect changes in the data structure. - Refactored admin routes for course registrations to streamline submission handling.
26 lines
603 B
PHP
26 lines
603 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\Manage;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class SaveCourseRegistrationRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
$student = $this->route('student');
|
|
|
|
return $this->user()->hasRole('mahasiswa')
|
|
&& $this->user()->student?->id === $student?->id;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'course_class_ids' => ['array'],
|
|
'course_class_ids.*' => ['integer'],
|
|
'signature' => ['nullable', 'file', 'image', 'max:2048'],
|
|
];
|
|
}
|
|
}
|