A Laravel Client for Torchlight, the syntax highlighting API.
Installs: 114 988
Open Issues: 13
- php: ^7.3|^8.0
- guzzlehttp/guzzle: ^7.2
- illuminate/cache: ^7.26.0|^8.0|^9.0|^10.0
- illuminate/console: ^7.26.0|^8.0|^9.0|^10.0
- illuminate/http: ^7.26.0|^8.0|^9.0|^10.0
- illuminate/support: ^7.26.0|^8.0|^9.0|^10.0
- illuminate/view: ^7.26.0|^8.0|^9.0|^10.0
- ramsey/uuid: ^3.7|^4.0
- mockery/mockery: ^1.3.3
- orchestra/testbench: ^5.0|^6.0|^7.0
- phpunit/phpunit: ^8.5.23|^9.5
A Torchlight syntax highlighting extension for the Laravel framework.
To install, require the package from composer:
composer require torchlight/torchlight-laravel
Once the package is downloaded, you can run the following command to publish your configuration file:
php artisan torchlight:install
Once run, you should see a new file
torchlight.php in you
config folder, with contents that look like this:
<?php return [ // The Torchlight client caches highlighted code blocks. Here // you can define which cache driver you'd like to use. 'cache' => env('TORCHLIGHT_CACHE_DRIVER'), // Which theme you want to use. You can find all of the themes at // https://torchlight.dev/themes, or you can provide your own. 'theme' => env('TORCHLIGHT_THEME', 'material-theme-palenight'), // Your API token from torchlight.dev. 'token' => env('TORCHLIGHT_TOKEN'), // If you want to register the blade directives, set this to true. 'blade_components' => true, // The Host of the API. 'host' => env('TORCHLIGHT_HOST', 'https://api.torchlight.dev'), ];
Set the cache driver that Torchlight will use.
You can change the theme of all your code blocks by adjusting the
theme key in your configuration.
This is your API token from torchlight.dev. (Torchlight is completely free for personal and open source projects.)
By default Torchlight works by using a custom Laravel component. If you'd like to disable the registration of the component for whatever reason, you can turn this to false.
You can change the host where your API requests are sent. Not sure why you'd ever want to do that, but you can!