Some service host/domain updates, including schema updates

This commit is contained in:
Deon George
2022-08-02 19:16:52 +10:00
parent 06b1eca306
commit 2bac177618
13 changed files with 283 additions and 340 deletions

View File

@@ -228,41 +228,6 @@ class ServiceController extends Controller
}
}
/**
* Edit a domain service details
*
* @param Request $request
* @param Service $o
* @return RedirectResponse
* @deprecated - use update()
*/
public function domain_edit(Request $request,Service $o)
{
session()->flash('service_update',TRUE);
$validation = $request->validate([
'service.domain_name' => ['required',function($attribute,$value,$fail) use ($request,$o) {
if (Service\Domain::where('domain_name',$value)
->where('domain_tld_id',Arr::get($request,'service.domain_tld_id'))
->when($o->type,function($q) use ($o) { return $q->where('id','<>',$o->type->id); })
->count() > 0)
{
$fail('Domain already exists.');
}
}],
'service.domain_expire' => 'required|date',
'service.domain_tld_id' => 'required|exists:ab_domain_tld,id',
'service.domain_registrar_id' => 'required|exists:ab_domain_registrar,id',
'service.registrar_account' => 'required',
'service.registrar_username' => 'required|string|min:5',
'service.registrar_ns' => 'required|string|min:5',
]);
$o->type->forceFill($validation['service'])->save();
return redirect()->back()->with('success','Record updated.');
}
/**
* List all the domains managed by the user
*