Compare commits

..

2 Commits

Author SHA1 Message Date
37adb14b9e Remove deprecated Domain::managed()
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 39s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m50s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
2024-05-29 19:20:26 +10:00
58adb63174 Fix for when no zones have been created yet in a domain 2024-05-29 19:20:26 +10:00

View File

@ -24,25 +24,8 @@ class DomainRequest extends FormRequest
$o = $this->route('o'); $o = $this->route('o');
return [ return [
'name' => [ 'name' => 'required|max:8|regex:/^[a-z-_~]{1,8}$/|unique:domains,name,'.($o->exists ? $o->id : 0),
'required', 'dnsdomain' => 'nullable|regex:/^(?!:\/\/)(?=.{1,255}$)((.{1,63}\.){1,127}(?![0-9]*$)[a-z0-9-]+\.?)$/i|unique:domains,dnsdomain,'.($o->exists ? $o->id : NULL),
'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', 'active' => 'required|boolean',
'public' => 'required|boolean', 'public' => 'required|boolean',
'accept_app' => 'required|boolean', 'accept_app' => 'required|boolean',