57 lines
1.4 KiB
PHP
57 lines
1.4 KiB
PHP
<?php
|
||
|
||
namespace App\Http\Controllers\Api;
|
||
|
||
use App\Http\Controllers\Controller;
|
||
use Illuminate\Http\Request;
|
||
|
||
/**
|
||
* @group Project Settings
|
||
*
|
||
* APIs for project-related settings and configurations.
|
||
*/
|
||
class ProjectAppUrlsController extends Controller
|
||
{
|
||
/**
|
||
* Get Project App URLs
|
||
*
|
||
* Returns a list of configured project names and their corresponding application URLs.
|
||
* This endpoint is public and requires no authentication.
|
||
*
|
||
* @response 200 {
|
||
* "status": "success",
|
||
* "data": [
|
||
* {
|
||
* "project_name": "208 - Dzerzhinsk",
|
||
* "url": "https://208.qms.stellarcons.com/admin"
|
||
* },
|
||
* {
|
||
* "project_name": "102 - VIKSA OMK",
|
||
* "url": "https://viksaqms.stellarcons.com/"
|
||
* }
|
||
* ]
|
||
* }
|
||
*
|
||
* @return \Illuminate\Http\JsonResponse
|
||
*/
|
||
public function index()
|
||
{
|
||
// "project-app-urls" ayarını getir
|
||
$settings = setting('project-app-urls');
|
||
|
||
// Eğer string gelirse decode et, zaten array/object ise olduğu gibi kullan
|
||
$data = is_string($settings) ? json_decode($settings, true) : $settings;
|
||
|
||
// Veri yoksa boş array döndür
|
||
if (is_null($data)) {
|
||
$data = [];
|
||
}
|
||
|
||
return response()->json([
|
||
'status' => 'success',
|
||
'data' => $data
|
||
]);
|
||
}
|
||
}
|
||
|