25 lines
685 B
PHP
25 lines
685 B
PHP
<?php
|
|
|
|
namespace App\Domains\Admin\Controllers;
|
|
|
|
use App\Models\Tenant;
|
|
use App\Scopes\CommonController;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
|
|
class TenantGeneralGetController extends CommonController
|
|
{
|
|
public function __invoke(string $slug, Request $request): JsonResponse
|
|
{
|
|
$tenant = Tenant::where('slug', $slug)->firstOrFail();
|
|
|
|
return response()->json([
|
|
'name' => $tenant->name,
|
|
'slug' => $tenant->slug,
|
|
'url' => $tenant->url,
|
|
'is_active_local_group' => $tenant->is_active_local_group,
|
|
'saveEndpoint' => '/api/v1/admin/tenants/' . $slug . '/general',
|
|
]);
|
|
}
|
|
}
|