trypost/app/Http/Requests/UpdatePostRequest.php

34 lines
879 B
PHP
Raw Normal View History

2026-01-15 01:13:44 +00:00
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdatePostRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
2026-01-15 17:24:39 +00:00
'status' => ['sometimes', 'string'],
'scheduled_at' => ['sometimes', 'nullable', 'string'],
2026-01-15 01:13:44 +00:00
'platforms' => ['sometimes', 'array'],
'platforms.*.id' => ['required', 'uuid', 'exists:post_platforms,id'],
'platforms.*.content' => ['nullable', 'string', 'max:5000'],
'label_ids' => ['sometimes', 'array'],
'label_ids.*' => ['uuid', 'exists:workspace_labels,id'],
2026-01-15 01:13:44 +00:00
];
}
public function messages(): array
{
return [
2026-01-15 17:24:39 +00:00
'scheduled_at.after' => 'The scheduled date must be in the future.',
2026-01-15 01:13:44 +00:00
];
}
}