25 lines
543 B
PHP
25 lines
543 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Http\Requests;
|
||
|
|
|
||
|
|
use App\Models\TaskComment;
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
use Illuminate\Validation\Rule;
|
||
|
|
|
||
|
|
class StoreTaskCommentRequest extends FormRequest
|
||
|
|
{
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function rules(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'body' => ['required', 'string'],
|
||
|
|
'author_type' => ['required', 'string', Rule::in(TaskComment::AUTHOR_TYPES)],
|
||
|
|
'author_name' => ['nullable', 'string', 'max:255'],
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|