1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Http/Controllers/SubdomainController.php

36 lines
791 B
PHP
Raw Normal View History

2021-03-22 21:09:42 +01:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
2023-01-28 23:21:40 +01:00
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
2021-03-22 21:09:42 +01:00
*
2021-06-16 08:58:16 +02:00
* @license https://www.elastic.co/licensing/elastic-license
2021-03-22 21:09:42 +01:00
*/
namespace App\Http\Controllers;
use App\Libraries\MultiDB;
class SubdomainController extends BaseController
{
public function __construct()
{
}
/**
2023-06-07 03:21:26 +02:00
* Return if a subdomain is available.
2021-03-22 21:09:42 +01:00
*
*/
public function index()
{
2023-06-07 03:21:26 +02:00
if (!MultiDB::checkDomainAvailable(request()->input('subdomain'))) {
return response()->json(['message' => 'Domain not available'], 401);
}
2021-03-22 21:09:42 +01:00
return response()->json(['message' => 'Domain available'], 200);
}
}