29 lines
573 B
PHP
29 lines
573 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\User;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreCommentRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'message' => ['required', 'string', 'max:2000'],
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'message.required' => 'Mesej komen tidak boleh kosong.',
|
|
'message.max' => 'Mesej terlalu panjang (maks 2,000 aksara).',
|
|
];
|
|
}
|
|
}
|