Files
citrus-cms/app/Http/Controllers/Api/ProjectAppUrlsController.php
T
2026-04-28 21:14:25 +03:00

57 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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
]);
}
}