26 lines
686 B
PHP
26 lines
686 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\NovaCards;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class AdminStoreNovaCardCategoryRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user() !== null;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'slug' => ['required', 'string', 'max:120', 'regex:/^[a-z0-9]+(?:-[a-z0-9]+)*$/'],
|
|
'name' => ['required', 'string', 'max:120'],
|
|
'description' => ['nullable', 'string', 'max:400'],
|
|
'active' => ['sometimes', 'boolean'],
|
|
'order_num' => ['sometimes', 'integer', 'min:0', 'max:9999'],
|
|
];
|
|
}
|
|
} |