Some checks failed
tests / ci (pull_request) Has been cancelled
- Created sub-namespaces under Admin\Manage for Course, Academic, Announcement, Finance, and Service. - Added new FormRequest classes for handling validation in each sub-namespace. - Implemented Service classes for managing business logic related to each resource. - Updated routes to reflect the new sub-namespace structure. - Enhanced code organization and maintainability by grouping related functionalities.
26 lines
710 B
PHP
26 lines
710 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\Manage\Academic;
|
|
|
|
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'],
|
|
];
|
|
}
|
|
}
|