optimizations

This commit is contained in:
2026-03-28 19:15:39 +01:00
parent 0b25d9570a
commit cab4fbd83e
509 changed files with 1016804 additions and 1605 deletions

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\NovaCards;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class AdminStoreNovaCardChallengeRequest extends FormRequest
{
public function authorize(): bool
{
return $this->user() !== null;
}
public function rules(): array
{
return [
'slug' => ['required', 'string', 'max:140', 'regex:/^[a-z0-9]+(?:-[a-z0-9]+)*$/'],
'title' => ['required', 'string', 'max:140'],
'description' => ['nullable', 'string', 'max:1000'],
'prompt' => ['nullable', 'string', 'max:1000'],
'rules_json' => ['nullable', 'array'],
'status' => ['required', Rule::in(['draft', 'active', 'completed', 'archived'])],
'official' => ['sometimes', 'boolean'],
'featured' => ['sometimes', 'boolean'],
'winner_card_id' => ['nullable', 'integer', 'exists:nova_cards,id'],
'starts_at' => ['nullable', 'date'],
'ends_at' => ['nullable', 'date', 'after_or_equal:starts_at'],
];
}
}