45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests\Bo\ClaimMessages;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
|
||
|
|
class UpdateMessageRequest extends FormRequest
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Determine if the user is authorized to make this request.
|
||
|
|
*
|
||
|
|
* @return boolean
|
||
|
|
*/
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return auth('backend')->check();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the validation rules that apply to the request.
|
||
|
|
*
|
||
|
|
* @return array
|
||
|
|
*/
|
||
|
|
public function rules(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'claim_message_id' => 'required|numeric|exists:claim_messages,id',
|
||
|
|
'content' => 'required|string|between:3,255',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get custom attributes for validator errors.
|
||
|
|
*
|
||
|
|
* @return array<string,\Illuminate\Contracts\Translation\Translator|string|array<mixed>|null>
|
||
|
|
*/
|
||
|
|
public function attributes(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'claim_message_id' => trans('models.classes.claim_messages'),
|
||
|
|
'content' => trans('validation.attributes.content'),
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|