phpldapadmin/app/Http/Requests/EntryRequest.php

34 lines
635 B
PHP
Raw Normal View History

2023-03-31 04:55:08 +00:00
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class EntryRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return TRUE;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, mixed>
*/
public function rules()
{
2023-04-12 13:18:26 +00:00
return config('server')
->schema('attributetypes')
->intersectByKeys($this->request)
->transform(function($item) { return $item->validation; })
->filter()
->flatMap(function($item) { return $item; })
->toArray();
2023-03-31 04:55:08 +00:00
}
}