feat: [boards] 게시판 API 시스템 구현
- BoardController, PostController 추가 - Board, BoardSetting 모델 수정 - BoardService 추가 - FormRequest 클래스 추가 - Swagger 문서 추가 (BoardApi, PostApi) - 게시판 시스템 필드 마이그레이션 추가
This commit is contained in:
29
app/Http/Requests/Boards/CommentStoreRequest.php
Normal file
29
app/Http/Requests/Boards/CommentStoreRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Boards;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CommentStoreRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'content' => 'required|string|max:2000',
|
||||
'parent_id' => 'nullable|integer|exists:board_comments,id',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'content.required' => __('validation.required', ['attribute' => '댓글 내용']),
|
||||
'content.max' => __('validation.max.string', ['attribute' => '댓글 내용', 'max' => 2000]),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user