33 lines
565 B
PHP
33 lines
565 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Requests;
|
||
|
|
||
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
use Illuminate\Validation\Rule;
|
||
|
|
||
|
use App\Rules\{DNExists,StructuralObjectClass};
|
||
|
|
||
|
class EntryAdd extends FormRequest
|
||
|
{
|
||
|
/**
|
||
|
* Get the validation rules that apply to the request.
|
||
|
*
|
||
|
* @return array<string, mixed>
|
||
|
*/
|
||
|
public function rules(): array
|
||
|
{
|
||
|
return [
|
||
|
'dn' => new DNExists,
|
||
|
'objectclass' => [
|
||
|
'required',
|
||
|
'string',
|
||
|
new StructuralObjectClass,
|
||
|
],
|
||
|
'step' => 'int|min:1|max:2',
|
||
|
'frame' => [
|
||
|
'string',
|
||
|
Rule::in(['create']),
|
||
|
]
|
||
|
];
|
||
|
}
|
||
|
}
|