- integrate spatie/icalendar-generator for candidate & panelist .ics invitations (RSVP & 15m alerts)
- add StoreInterviewRequest, ScheduleInterviewDto, and invitation/reminder queued actions
- add migration for job_title, round, description, and reminder_sent_at on interviews table
- style datetime-local picker indicators to pure white on dark input backgrounds
- support button loading spinners with :showLoader="true" and loadingText
- auto-open schedule drawer on validation failure with inline @error alerts and old() bindings
60 lines
2.2 KiB
PHP
60 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Interview;
|
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreInterviewRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'candidate_name' => ['required', 'string', 'max:255'],
|
|
'candidate_email' => ['required', 'email', 'max:255'],
|
|
'candidate_phone' => ['required', 'string', 'max:50'],
|
|
'job_title' => ['required', 'string', 'max:255'],
|
|
'round' => ['nullable', 'string', 'max:100'],
|
|
'description' => ['nullable', 'string', 'max:2000'],
|
|
'scheduled_at' => ['nullable', 'date'],
|
|
'valid_hours' => ['required', 'integer', 'min:1', 'max:72'],
|
|
'language' => ['required', 'string', 'in:python,cpp,c,java,php,javascript'],
|
|
'assigned_interviewers' => ['nullable', 'array'],
|
|
'assigned_interviewers.*' => ['integer', 'exists:users,id'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get custom messages for validator errors.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'candidate_name.required' => 'The candidate name is required.',
|
|
'candidate_email.required' => 'The candidate email address is required.',
|
|
'candidate_email.email' => 'Please provide a valid candidate email address.',
|
|
'candidate_phone.required' => 'The candidate phone number is required.',
|
|
'job_title.required' => 'The job title / position is required.',
|
|
'valid_hours.required' => 'Access duration is required.',
|
|
'language.required' => 'Coding language selection is required.',
|
|
'language.in' => 'Selected coding language is not supported.',
|
|
'assigned_interviewers.*.exists' => 'One or more selected interviewers are invalid.',
|
|
];
|
|
}
|
|
}
|