public function savePageComment(Request $request, int $pageId)
{
$this->validate($request, [
- 'text' => 'required|string',
- 'parent_id' => 'nullable|integer',
+ 'text' => ['required', 'string'],
+ 'parent_id' => ['nullable', 'integer'],
]);
$page = Page::visible()->find($pageId);
public function update(Request $request, int $commentId)
{
$this->validate($request, [
- 'text' => 'required|string',
+ 'text' => ['required', 'string'],
]);
$comment = $this->commentRepo->getById($commentId);