PHP code example of daikazu / filament-size-visualizer-field
1. Go to this page and download the library: Download daikazu/filament-size-visualizer-field 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/ */
daikazu / filament-size-visualizer-field example snippets
public function getFormSchema(): array
{
return [
Section::make('Filament Size Visualizer Example')
->schema([
Fieldset::make('Rounded Size Visualizer')
->columns(1)
->schema([
TextInput::make('size')
->debounce(600)
->type('range')
->minValue(1)
->maxValue(15)
->extraInputAttributes(['step' => 0.25])
->live()
->numeric()
->default(2),
Toggle::make('show_coin')
->live(),
RoundedSizeVisualizer::make('size')
->size(960)
->padding(50)
->sizeText('Inches')
->staticObjectImage(asset('vendor/filament-size-visualizer-field/assets/quarter.png'))
->dynamicObjectImage(asset('vendor/filament-size-visualizer-field/assets/example-1.png'))
->showStaticObject(fn (Get $get) => $get('show_coin')),
]),
]),
];
}