Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/Admin/DomainsController.php
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | public function suspend(Request $request, $id) | ||||
if (!$this->checkTenant($domain) || $domain->isPublic()) { | if (!$this->checkTenant($domain) || $domain->isPublic()) { | ||||
return $this->errorResponse(404); | return $this->errorResponse(404); | ||||
} | } | ||||
$domain->suspend(); | $domain->suspend(); | ||||
return response()->json([ | return response()->json([ | ||||
'status' => 'success', | 'status' => 'success', | ||||
'message' => __('app.domain-suspend-success'), | 'message' => \trans('app.domain-suspend-success'), | ||||
]); | ]); | ||||
} | } | ||||
/** | /** | ||||
* Un-Suspend the domain | * Un-Suspend the domain | ||||
* | * | ||||
* @param \Illuminate\Http\Request $request The API request. | * @param \Illuminate\Http\Request $request The API request. | ||||
* @param string $id Domain identifier | * @param string $id Domain identifier | ||||
* | * | ||||
* @return \Illuminate\Http\JsonResponse The response | * @return \Illuminate\Http\JsonResponse The response | ||||
*/ | */ | ||||
public function unsuspend(Request $request, $id) | public function unsuspend(Request $request, $id) | ||||
{ | { | ||||
$domain = Domain::find($id); | $domain = Domain::find($id); | ||||
if (!$this->checkTenant($domain) || $domain->isPublic()) { | if (!$this->checkTenant($domain) || $domain->isPublic()) { | ||||
return $this->errorResponse(404); | return $this->errorResponse(404); | ||||
} | } | ||||
$domain->unsuspend(); | $domain->unsuspend(); | ||||
return response()->json([ | return response()->json([ | ||||
'status' => 'success', | 'status' => 'success', | ||||
'message' => __('app.domain-unsuspend-success'), | 'message' => \trans('app.domain-unsuspend-success'), | ||||
]); | ]); | ||||
} | } | ||||
} | } |