aiblog/app/Http/Requests/Post/UpdatePostRequest.php
2024-11-17 11:30:01 +08:00

25 lines
No EOL
518 B
PHP

<?php
declare(strict_types=1);
namespace App\Http\Requests\Post;
use Illuminate\Foundation\Http\FormRequest;
class UpdatePostRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'title' => 'sometimes|string|max:255',
'content' => 'sometimes|string',
'category_id' => 'nullable|exists:categories,id',
'summary' => 'nullable|string|max:500',
];
}
}