Files
sam-api/app/Http/Requests/V1/Equipment/UpdateEquipmentRequest.php

42 lines
1.5 KiB
PHP
Raw Normal View History

<?php
namespace App\Http\Requests\V1\Equipment;
use Illuminate\Foundation\Http\FormRequest;
class UpdateEquipmentRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'equipment_code' => 'sometimes|string|max:50',
'name' => 'sometimes|string|max:100',
'equipment_type' => 'nullable|string|max:50',
'specification' => 'nullable|string|max:200',
'manufacturer' => 'nullable|string|max:100',
'model_name' => 'nullable|string|max:100',
'serial_no' => 'nullable|string|max:100',
'location' => 'nullable|string|max:100',
'production_line' => 'nullable|string|max:50',
'purchase_date' => 'nullable|date',
'install_date' => 'nullable|date',
'purchase_price' => 'nullable|numeric|min:0',
'useful_life' => 'nullable|integer|min:0',
'status' => 'nullable|in:active,idle,disposed',
'disposed_date' => 'nullable|date',
'manager_id' => 'nullable|integer|exists:users,id',
'sub_manager_id' => 'nullable|integer|exists:users,id',
'photo_path' => 'nullable|string|max:500',
'memo' => 'nullable|string',
'options' => 'nullable|array',
'is_active' => 'nullable|boolean',
'sort_order' => 'nullable|integer|min:0',
];
}
}