valentin-morice/filament-sketchpad

A simple package that provides you with a sketchpad field in Filament

1.0.0 2024-08-24 14:09 UTC

This package is auto-updated.

Last update: 2025-01-31 00:30:48 UTC


README

Screenshot from 2024-08-24 15-37-49

A simple package that provides you with a sketchpad field in Filament

Installation

You can install the package via composer:

composer require valentin-morice/filament-sketchpad

Usage

The filament-sketchpad plugin works as any other Filament Form Builder class. Make sure the column on which it is called is cast to JSON.

public static function form(Form $form): Form
    {
        return $form
            ->schema([
                FilamentSketchpad::make('example'),
            ]);
    }

Set the height

FilamentSketchpad::make('example')->height(int 400|Closure); // in px

NOTE: All standard injected utilities are available in your closure.

Thanks to http://yiom.github.io/sketchpad/ for the JS.

License

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