Compare commits
2 Commits
37adb14b9e
...
d53ca09c0c
Author | SHA1 | Date | |
---|---|---|---|
d53ca09c0c | |||
195d88b84d |
@ -24,8 +24,25 @@ class DomainRequest extends FormRequest
|
||||
$o = $this->route('o');
|
||||
|
||||
return [
|
||||
'name' => 'required|max:8|regex:/^[a-z-_~]{1,8}$/|unique:domains,name,'.($o->exists ? $o->id : 0),
|
||||
'dnsdomain' => 'nullable|regex:/^(?!:\/\/)(?=.{1,255}$)((.{1,63}\.){1,127}(?![0-9]*$)[a-z0-9-]+\.?)$/i|unique:domains,dnsdomain,'.($o->exists ? $o->id : NULL),
|
||||
'name' => [
|
||||
'required',
|
||||
'max:8',
|
||||
'regex:/^[a-z-_~]{1,8}$/',
|
||||
Rule::unique('domains')
|
||||
->where(fn($query)=>$query
|
||||
->where('name',$request->post('name'))
|
||||
->when($o?->exists,fn($query)=>$query->where('id','<>',$o->id))
|
||||
)
|
||||
],
|
||||
'dnsdomain' => [
|
||||
'nullable',
|
||||
'regex:/^(?!:\/\/)(?=.{1,255}$)((.{1,63}\.){1,127}(?![0-9]*$)[a-z0-9-]+\.?)$/i',
|
||||
Rule::unique('domains')
|
||||
->where(fn($query)=>$query
|
||||
->where('dnsdomain',$request->post('dnsdomain'))
|
||||
->when($o?->exists,fn($query)=>$query->where('id','<>',$o->id))
|
||||
)
|
||||
],
|
||||
'active' => 'required|boolean',
|
||||
'public' => 'required|boolean',
|
||||
'accept_app' => 'required|boolean',
|
||||
|
Loading…
Reference in New Issue
Block a user