mirror of
https://github.com/anonaddy/anonaddy
synced 2026-04-25 17:15:29 +02:00
44 lines
965 B
PHP
44 lines
965 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use App\Rules\ValidAliasLocalPart;
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class TestAutoCreateRegexRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'resource' => [
|
|
'required',
|
|
'in:username,domain',
|
|
],
|
|
'id' => [
|
|
'required',
|
|
'uuid',
|
|
],
|
|
'local_part' => [
|
|
'required',
|
|
'max:255',
|
|
'ascii',
|
|
new ValidAliasLocalPart,
|
|
],
|
|
];
|
|
}
|
|
}
|