2026-07-18 17:22:16 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
|
|
|
|
|
|
use App\Models\Post;
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
|
|
|
|
|
class UpdatePostRequest extends FormRequest
|
|
|
|
|
{
|
|
|
|
|
public function authorize(): bool
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function rules(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'site_id' => ['sometimes', 'required', 'integer', 'exists:sites,id'],
|
|
|
|
|
'social_account_id' => ['nullable', 'integer', 'exists:social_accounts,id'],
|
|
|
|
|
'type' => ['sometimes', 'required', 'string', 'in:' . implode(',', Post::TYPES)],
|
|
|
|
|
'title' => ['nullable', 'string', 'max:255'],
|
|
|
|
|
'body' => ['sometimes', 'required', 'string'],
|
2026-07-21 14:04:45 +03:00
|
|
|
'target' => ['nullable', 'string', 'max:255'],
|
2026-07-18 17:22:16 +03:00
|
|
|
'status' => ['sometimes', 'string', 'in:' . implode(',', Post::STATUSES)],
|
|
|
|
|
'scheduled_at' => ['nullable', 'date'],
|
2026-07-21 14:04:45 +03:00
|
|
|
'published_url' => ['nullable', 'string', 'max:255'],
|
2026-07-18 17:22:16 +03:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|