feat: create PostCategoryFactory for generating post category data feat: create PostFactory for generating post data feat: add retry_requested_at column to services table feat: add vcenter provisioning fields to products table feat: add module_host_id to os table feat: create email_notification_templates table for email templates feat: add scenario and format fields to template table feat: add admin fields to transactions table fix: update ticket table columns and types feat: add uuid to ticket table and backfill existing records fix: make ticket_reply user_id nullable feat: create notifications table for user notifications fix: make ticket uuid nullable feat: create post_categories table for blog categories feat: create posts table for blog posts feat: add invoice email template for PDF generation
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class PostUpdateRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
$id = (int) $this->route('id');
|
|
|
|
return [
|
|
'post_category_id' => 'required|integer|exists:post_categories,id',
|
|
'title' => 'required|string|max:255',
|
|
'slug' => ['nullable', 'string', 'max:255', Rule::unique('posts', 'slug')->ignore($id)],
|
|
'excerpt' => 'nullable|string',
|
|
'content' => 'required|string',
|
|
'thumbnail' => 'nullable|string|max:255',
|
|
'status' => 'required|in:draft,published,hidden',
|
|
'is_featured' => 'nullable|boolean',
|
|
'view_count' => 'nullable|integer|min:0',
|
|
'reading_time' => 'nullable|integer|min:1',
|
|
'meta_title' => 'nullable|string|max:255',
|
|
'meta_description' => 'nullable|string',
|
|
'published_at' => 'nullable|date',
|
|
];
|
|
}
|
|
}
|