https://github.com/torchlight-api/torchlight-laravel
A Laravel client for Torchlight - the syntax highlighting API.
https://github.com/torchlight-api/torchlight-laravel
code-highlighter laravel laravel-client syntax-highlighting torchlight vscode
Last synced: 24 days ago
JSON representation
A Laravel client for Torchlight - the syntax highlighting API.
- Host: GitHub
- URL: https://github.com/torchlight-api/torchlight-laravel
- Owner: torchlight-api
- License: mit
- Created: 2021-03-13T17:28:38.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-22T15:41:59.000Z (11 months ago)
- Last Synced: 2025-12-26T16:51:02.456Z (about 2 months ago)
- Topics: code-highlighter, laravel, laravel-client, syntax-highlighting, torchlight, vscode
- Language: PHP
- Homepage: https://torchlight.dev
- Size: 124 KB
- Stars: 119
- Watchers: 2
- Forks: 18
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Torchlight Client
[](https://github.com/torchlight-api/torchlight-laravel/actions/workflows/tests.yml) [](//packagist.org/packages/torchlight/torchlight-laravel) [](//packagist.org/packages/torchlight/torchlight-laravel) [](//packagist.org/packages/torchlight/torchlight-laravel)
A [Torchlight](https://torchlight.dev) syntax highlighting extension for the [Laravel](https://laravel.com/) framework.
Torchlight is a VS Code-compatible syntax highlighter that requires no JavaScript, supports every language, every VS Code theme, line highlighting, git diffing, and more.
## Installation
To install, require the package from composer:
```
composer require torchlight/torchlight-laravel
```
## Configuration
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
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'),
];
```
### Cache
Set the cache driver that Torchlight will use.
### Theme
You can change the theme of all your code blocks by adjusting the `theme` key in your configuration.
### Token
This is your API token from [torchlight.dev](https://torchlight.dev). (Torchlight is completely free for personal and open source projects.)
### Blade Components
By default Torchlight works by using a [custom Laravel component](https://laravel.com/docs/master/blade#components). If you'd like to disable the registration of the component for whatever reason, you can turn this to false.
### Host
You can change the host where your API requests are sent. Not sure why you'd ever want to do that, but you can!