Is there any way to fetch the available languages from cockpit?
There is no entrypoint in the core, but you can create your own own. Create a file
<?php return $this['languages'];
Now fetch it with
This does not work for me, my
config.php looks like this:
<?php return [ # define the languages you want to manage 'languages' => [ 'default' => 'English', 'de' => 'Deutsch' ], ];
and I added the
getLanguages.php-file as you said.
I added an access key for
/getLanguages, but the endpoint still returns 404 Not Found.
It seems, that
$app is not available in the custom api endpoints. Use
$this instead. I updated my previous post.
If it still doesn’t work, you may have to change your custom api key from
And if you want to allow public access without any api key, just move the file into
config/api/public/getLanguages.php and fetch it via
That was it, working like a charm now! Thanks a bunch. Also for the