create api for register road observation
This commit is contained in:
@@ -35,11 +35,11 @@ class UpdateRequest extends FormRequest
|
||||
'accident_date' => 'required|date',
|
||||
'accident_time' => 'required|string',
|
||||
'report_base' => 'required|in:0,1',
|
||||
'police_file' => 'required_if:report_base,0|file|mimes:pdf,jpg,jpeg,png',
|
||||
'police_file' => 'file|mimes:pdf,jpg,jpeg,png',
|
||||
'police_serial' => 'required_if:report_base,0|string',
|
||||
'police_file_date' => 'required_if:report_base,0|date',
|
||||
'damage_picture1' => 'required|file|mimes:pdf,jpg,jpeg,png',
|
||||
'damage_picture2' => 'required|file|mimes:pdf,jpg,jpeg,png',
|
||||
'damage_picture1' => 'file|mimes:pdf,jpg,jpeg,png',
|
||||
'damage_picture2' => 'file|mimes:pdf,jpg,jpeg,png',
|
||||
'damage_items' => 'required|array',
|
||||
'damage_items.*.value' => 'required',
|
||||
'damage_items.*.amount' => 'required',
|
||||
|
||||
29
app/Http/Requests/V3/RoadObservation/ReferRequest.php
Normal file
29
app/Http/Requests/V3/RoadObservation/ReferRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\RoadObservation;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ReferRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->roadObserved->rms_status == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'edarate_shahri_id' => 'required|exists:edarate_shahri,id',
|
||||
'refer_description' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user