- Created SubmissionService to handle submission logic for assignments. - Added migrations for assignments and submissions tables. - Implemented AssignmentSeeder and SubmissionSeeder for initial data. - Updated DatabaseSeeder to include new seeders. - Enhanced app sidebar to include assignments navigation. - Developed datetime field component for better date and time input. - Created assignment management pages with data tables for assignments and submissions. - Implemented forms for creating and editing assignments and submissions. - Added routes for assignment and submission management in admin panel. - Defined types for assignments and submissions to improve type safety.
26 lines
701 B
PHP
26 lines
701 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\Manage;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class AssignmentRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'course_class_id' => ['required', 'integer', Rule::exists('course_classes', 'id')],
|
|
'title' => ['required', 'string', 'max:150'],
|
|
'description' => ['nullable', 'string'],
|
|
'deadline' => ['required', 'date'],
|
|
'attachment' => ['nullable', 'file', 'max:10240', 'mimes:pdf,doc,docx,ppt,pptx,xls,xlsx,jpg,jpeg,png,mp4,zip'],
|
|
];
|
|
}
|
|
}
|