60 lines
2.0 KiB
PHP
60 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V3\RoadMaintenanceStation;
|
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateRequest 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|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'province_id' => 'required|exists:provinces,id',
|
|
'city_id' => 'required|exists:cities,id',
|
|
'name' => 'required|string|max:255',
|
|
'status' => 'integer|in:0,1',
|
|
'type' => 'integer|in:1,2,3',
|
|
'team_num' => 'numeric',
|
|
'staff_num' => 'numeric',
|
|
'phone' => 'string|max:50',
|
|
'responsible_name' => 'string|max:255',
|
|
'responsible_mobile' => 'string|max:50',
|
|
'successor_name' => 'string|max:255',
|
|
'successor_mobile' => 'string|max:50',
|
|
'machines_light' => 'numeric',
|
|
'machines_sheavy' => 'numeric',
|
|
'machines_heavy' => 'numeric',
|
|
'lat' => 'numeric',
|
|
'lng' => 'numeric',
|
|
'lat_from' => 'numeric',
|
|
'lng_from' => 'numeric',
|
|
'lat_to' => 'numeric',
|
|
'lng_to' => 'numeric',
|
|
'color' => 'numeric',
|
|
'geometry' => 'numeric',
|
|
'overview_files_1' => 'file|mimes:jpg,jpeg,png,pdf|max:5120',
|
|
'overview_files_2' => 'file|mimes:jpg,jpeg,png,pdf|max:5120',
|
|
'overview_files_3' => 'file|mimes:jpg,jpeg,png,pdf|max:5120',
|
|
'overview_files_4' => 'file|mimes:jpg,jpeg,png,pdf|max:5120',
|
|
'overview_files_5' => 'file|mimes:jpg,jpeg,png,pdf|max:5120',
|
|
'area' => 'required|array',
|
|
'area.type' => 'required|string',
|
|
'area.coordinates' => 'required|array',
|
|
];
|
|
}
|
|
}
|