* Enable creation of new entries, * Change all our ajax frames to go through /frames URI instead of /dn, * Add our frame command to the encrypted DN, * Automatically redirect to root URL when selecting a tree item and currently in another path (as a result of a prior POST activity), * Some validation improvements DNExists/HasStructuralObjectClass
24 lines
496 B
PHP
24 lines
496 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class EntryRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return config('server')
|
|
->schema('attributetypes')
|
|
->intersectByKeys($this->request)
|
|
->map(fn($item)=>$item->validation(request()?->get('objectclass') ?: []))
|
|
->filter()
|
|
->flatMap(fn($item)=>$item)
|
|
->toArray();
|
|
}
|
|
} |