43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api\Setting;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Setting;
|
|
|
|
/**
|
|
* @OA\Tag(
|
|
* name="Settings",
|
|
* description="API Endpoints for Application Settings"
|
|
* )
|
|
*/
|
|
class SettingController extends Controller
|
|
{
|
|
/**
|
|
* @OA\Get(
|
|
* path="/setting",
|
|
* operationId="getSetting",
|
|
* tags={"Settings"},
|
|
* summary="Get application settings",
|
|
* description="Returns the application settings",
|
|
* @OA\Response(
|
|
* response=200,
|
|
* description="Successful operation",
|
|
* @OA\JsonContent(
|
|
* @OA\Property(property="data", type="object"),
|
|
* @OA\Property(property="message", type="string", example="Get setting successfully"),
|
|
* @OA\Property(property="error", type="boolean", example=false)
|
|
* )
|
|
* )
|
|
* )
|
|
*/
|
|
public function getSetting()
|
|
{
|
|
$setting = Setting::where('key', 'setting')->first();
|
|
return response()->json([
|
|
'data' => $setting->value,
|
|
'message' => 'Get setting successfully',
|
|
'error' => false
|
|
]);
|
|
}
|
|
} |