Update HostingSubscriptionsController.php

This commit is contained in:
Bozhidar 2024-05-12 21:28:30 +03:00
parent d43c776c65
commit 8231c20ed4

View file

@ -27,6 +27,15 @@ class HostingSubscriptionsController extends ApiController
public function store(HostingSubscriptionCreateRequest $request)
{
$findDomain = Domain::where('domain', $request->domain)->first();
if ($findDomain) {
return response()->json([
'status' => 'error',
'message' => 'Domain already exists',
], 400);
}
$hostingSubscription = new HostingSubscription();
$hostingSubscription->customer_id = $request->customer_id;
$hostingSubscription->hosting_plan_id = $request->hosting_plan_id;