. */ namespace FireflyIII\Api\V1\Controllers\System; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Support\Binder\StaticConfigKey; use Illuminate\Http\JsonResponse; /** * Class StaticConfigController * * Show specific Firefly III configuration and/or ENV vars. */ class StaticConfigController extends Controller { private array $list; /** * EnvController constructor. */ public function __construct() { parent::__construct(); $this->list = StaticConfigKey::$accepted; } /** * Show all available env variables. * * @return JsonResponse */ public function index(): JsonResponse { $vars = []; // show all Firefly III config vars. foreach ($this->list as $key) { $vars[$key] = config($key); } return response()->json($vars); } /** * @param string $staticKey * * @return JsonResponse */ public function show(string $staticKey): JsonResponse { $response = [$staticKey => config($staticKey)]; return response()->json($response); } }