28 lines
714 B
PHP
28 lines
714 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests\Boards;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
|
||
|
|
class PostUpdateRequest extends FormRequest
|
||
|
|
{
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function rules(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'title' => 'sometimes|string|max:200',
|
||
|
|
'content' => 'sometimes|string',
|
||
|
|
'editor_type' => 'sometimes|string|in:wysiwyg,markdown,text',
|
||
|
|
'is_notice' => 'sometimes|boolean',
|
||
|
|
'is_secret' => 'sometimes|boolean',
|
||
|
|
'status' => 'sometimes|string|in:draft,published,hidden',
|
||
|
|
'custom_fields' => 'nullable|array',
|
||
|
|
'custom_fields.*' => 'nullable',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|