32 lines
719 B
PHP
32 lines
719 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests\Approval;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
|
||
|
|
class UpdateRequest extends FormRequest
|
||
|
|
{
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function rules(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'form_id' => 'nullable|integer|exists:approval_forms,id',
|
||
|
|
'title' => 'nullable|string|max:200',
|
||
|
|
'content' => 'nullable|array',
|
||
|
|
'attachments' => 'nullable|array',
|
||
|
|
'attachments.*' => 'integer|exists:files,id',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function messages(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'form_id.exists' => __('validation.exists', ['attribute' => '결재양식']),
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|