1. Go to this page and download the library: Download saade/filament-autograph library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
saade / filament-autograph example snippets
use Saade\FilamentAutograph\Forms\Components\SignaturePad;
SignaturePad::make('signature')
use Saade\FilamentAutograph\Forms\Components\SignaturePad;
SignaturePad::make('signature')
->backgroundColor('rgba(0,0,0,0)') // Background color on light mode
->backgroundColorOnDark('#f0a') // Background color on dark mode (defaults to backgroundColor)
->exportBackgroundColor('#f00') // Background color on export (defaults to backgroundColor)
->penColor('#000') // Pen color on light mode
->penColorOnDark('#fff') // Pen color on dark mode (defaults to penColor)
->exportPenColor('#0f0') // Pen color on export (defaults to penColor)
use Saade\FilamentAutograph\Forms\Components\SignaturePad;
use Saade\FilamentAutograph\Forms\Components\Enums\DownloadableFormat;
SignaturePad::make('signature')
->filename('autograph') // Filename of the downloaded file (defaults to 'signature')
->downloadable() // Allow download of the signature (defaults to false)
->downloadableFormats([ // Available formats for download (defaults to all)
DownloadableFormat::PNG,
DownloadableFormat::JPG,
DownloadableFormat::SVG,
])
->downloadActionDropdownPlacement('center-end') // Dropdown placement of the download action (defaults to 'bottom-end')
use Saade\FilamentAutograph\Forms\Components\SignaturePad;
SignaturePad::make('signature')
->clearable(false)
->downloadable(false)
->undoable(false)
->confirmable(false)
SignaturePad::make('signature')
->confirmable() // Requires user to click on 'Done' (defaults to false)