- Created LetterRequestRequest and LetterRequestStatusRequest for handling form requests. - Removed the old LetterRequestRequest class and updated the authorization logic. - Changed the student relationship to user in the LetterRequest model. - Updated LetterRequestService to reflect changes in the model and request handling. - Modified permission catalog to include new permissions for letter request status updates. - Updated database migrations and seeders to use user_id instead of student_id. - Removed student-specific letter request pages and components, consolidating functionality under admin routes. - Adjusted frontend components to accommodate new data structure and permissions. - Enhanced the letter request columns to support status updates directly from the table.
24 lines
614 B
PHP
24 lines
614 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\Services\LetterRequest;
|
|
|
|
use App\Enums\LetterStatus;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class LetterRequestStatusRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user()->can('update-letter-requests-status');
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'status' => ['nullable', 'required_without:result', Rule::enum(LetterStatus::class)],
|
|
'result' => ['nullable', 'file', 'max:10240', 'mimes:pdf,jpg,jpeg,png,doc,docx'],
|
|
];
|
|
}
|
|
}
|