mansoor/filament-torchlight

This is my package filament-torchlight

v0.0.3 2023-08-08 16:51 UTC

README

Latest Version on Packagist Total Downloads

A Torchlight plugin for FilamentPHP, it provides a read-only field to hightlight the code under field.

Installation

To install, require the package from composer:

composer require mansoor/filament-torchlight

⚠️ Use version 0.0.2 for Filament 2 support ⚠️

composer require "creagia/filament-code-field:^0.0.2"

Setup Torchlight

You must follow the Torchlight documentation to Add Torchlight Middleware and Publish the Torchlight configuration file

Once you are done. Make sure to create an API Token from torchlight.dev and add to your .env file.

TORCHLIGHT_TOKEN=your_token_goes_here

Usage

use Mansoor\FilamentTorchlight\TorchlightCode;

class FileResource extends Resource
{
    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                TorchlightCode::make('code')
                    ->columnSpanFull()
                    ->theme('github-dark')
                    ->language('php')
            ]);
    }
}

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.