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,34 @@
<?php
declare(strict_types=1);
namespace App\Http\Requests\NovaCards;
use App\Models\NovaCard;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreNovaCardDraftRequest extends FormRequest
{
public function authorize(): bool
{
return $this->user() !== null;
}
public function rules(): array
{
return [
'title' => ['nullable', 'string', 'min:2', 'max:' . (int) config('nova_cards.validation.title_max', 120)],
'quote_text' => ['nullable', 'string', 'min:' . (int) config('nova_cards.validation.quote_min', 3), 'max:' . (int) config('nova_cards.validation.quote_max', 420)],
'quote_author' => ['nullable', 'string', 'max:160'],
'quote_source' => ['nullable', 'string', 'max:180'],
'description' => ['nullable', 'string', 'max:' . (int) config('nova_cards.validation.description_max', 500)],
'format' => ['nullable', Rule::in(array_keys((array) config('nova_cards.formats', [])))],
'template_id' => ['nullable', 'integer', 'exists:nova_card_templates,id'],
'category_id' => ['nullable', 'integer', 'exists:nova_card_categories,id'],
'background_type' => ['nullable', Rule::in(['gradient', 'upload', 'template', 'solid'])],
'tags' => ['nullable', 'array', 'max:' . (int) config('nova_cards.validation.max_tags', 8)],
'tags.*' => ['string', 'min:2', 'max:32'],
];
}
}