36 lines
1.2 KiB
PHP
36 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateResumeComponentPlacementRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user()->can('update', $this->resume_component_placement);
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'id' => 'required|exists:resume_component_placements,id',
|
|
'order' => 'required|integer',
|
|
'component_data.id' => 'required|exists:resume_component_data,id',
|
|
'component_data.component.id' => 'required|exists:resume_components,id',
|
|
'component_data.input_data' => 'required|array',
|
|
'component_data.input_data.*.id' => 'required|exists:resume_component_input_data,id',
|
|
'component_data.input_data.*.value' => 'present',
|
|
'component_data.input_data.*.component_input.id' => 'required|exists:resume_component_inputs,id',
|
|
];
|
|
}
|
|
}
|