- Add many-to-many relationship between posts and workspace labels - Add label selector in post edit page with autosave - Display labels in posts list - Add hashtags modal with search for appending hashtags to post content - Fix sidebar active state for posts edit page - Fix AvatarImage null src warning in SocialAccountsGrid - Fix new post state by using Inertia::location for full page reload - Hide close button on CommandDialog by default
33 lines
879 B
PHP
33 lines
879 B
PHP
<?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 [
|
|
'status' => ['sometimes', 'string'],
|
|
'scheduled_at' => ['sometimes', 'nullable', 'string'],
|
|
'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'],
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'scheduled_at.after' => 'The scheduled date must be in the future.',
|
|
];
|
|
}
|
|
}
|