Models refactor + Basic functionnalities
This commit is contained in:
28
app/Http/Requests/StoreResumeComponentPlacementRequest.php
Normal file
28
app/Http/Requests/StoreResumeComponentPlacementRequest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreResumeComponentPlacementRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
35
app/Http/Requests/UpdateResumeComponentPlacementRequest.php
Normal file
35
app/Http/Requests/UpdateResumeComponentPlacementRequest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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' => 'required|string',
|
||||
'component_data.input_data.*.component_input.id' => 'required|exists:resume_component_inputs,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user