- Move middleware to App/ subdir (HandleInertiaRequests, HandleAppearance, EnsureSubscribed, EnsureUserSetupIsComplete) matching Sendkit pattern - Move all Form Requests into organized subdirs (App/Post, App/Workspace, App/Media, App/Invite, App/Settings, App/Auth) - Create AuthUserResource and AuthWorkspaceResource for HandleInertiaRequests shared data (role inside currentWorkspace, matching Sendkit pattern) - Split auth.php into 3 route groups (no middleware, guest, auth) matching Sendkit pattern exactly - Fix UserFactory to include all nullable attributes (current_workspace_id, stripe_id, pm_type, pm_last_four, trial_ends_at) - Fix SocialAccountResource (display_name not name) - Update frontend for new auth prop structure - 702 tests passing (2 pre-existing Mastodon failures)
33 lines
888 B
PHP
33 lines
888 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\App\Post;
|
|
|
|
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.',
|
|
];
|
|
}
|
|
}
|