torchlight-laravel
torchlight-laravel copied to clipboard
Option to ignore Torchlight when there's a missing token
Is it possible to disable the exceptions when there's a missing token?
For example, we have a documentation site that people will want to contribute to. When contributors run the site locally, if they don't add an API token, they'll run into an exception.
We can work around this by either setting the app environment to production, or make our token available to everyone, but those both feel dangerous.
I had this issue too and solved by checking if an API token is sett in the config, then dynamically adding the Torchlight middleware it in the HTTP Kernel and dynamically adding the extension to the CommonMark parser.