Files
website/website/app/Http/Requests/Admin/UpdateKbCategoryRequest.php
Claude Dev de8ec69ea0 feat: add advanced features — KB, tickets v2, multi-currency, cart, quotes, affiliates, credits, staff RBAC, fraud detection, service panels
Major additions:
- Knowledge base with categories, articles, revisions, and voting
- Enhanced ticket system: departments, SLA policies, canned responses, tags, custom fields, satisfaction ratings, internal notes
- Multi-currency support with exchange rate sync
- Shopping cart and quote system with PDF generation
- Affiliate program with referrals, commissions, and payouts
- Account credits, credit notes, and debit notes
- Staff management with granular role-based permissions
- Fraud detection and order risk assessment
- ServerHunter SEO integration
- Service lifecycle events (suspend/unsuspend/terminate)
- Service management panels for VPS, Dedicated, Hosting, and Game servers
- Plan lifecycle fields and per-customer overrides
- 30+ migrations, 17 factories, 8 feature test suites

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 07:35:10 -04:00

44 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UpdateKbCategoryRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/** @return array<string, array<int, mixed>> */
public function rules(): array
{
$categoryId = $this->route('category')?->id;
return [
'name' => ['required', 'string', 'max:255'],
'slug' => ['required', 'string', 'max:255', Rule::unique('knowledge_base_categories', 'slug')->ignore($categoryId)],
'description' => ['nullable', 'string', 'max:5000'],
'icon' => ['nullable', 'string', 'max:255'],
'parent_id' => ['nullable', 'integer', Rule::exists('knowledge_base_categories', 'id')],
'sort_order' => ['integer', 'min:0'],
'is_visible' => ['boolean'],
];
}
/** @return array<string, string> */
public function messages(): array
{
return [
'name.required' => 'Category name is required.',
'slug.required' => 'Category slug is required.',
'slug.unique' => 'This slug is already in use.',
'parent_id.exists' => 'The selected parent category does not exist.',
];
}
}