bolt

On this page

  1. Composer

Composer

for example we want to allow our users to use rating in the forms: first install the package:

composer require yepsua/filament-rating-field

create a file in Zeus\Fields\Rating.php the file name must be the same as the component class

<?php

namespace App\Zeus\Fields;

use LaraZeus\Bolt\Fields\FieldsContract;

class Rating extends FieldsContract
{
    public $renderClass = '\Yepsua\Filament\Forms\Components\Rating';
    public $sort = 8;

    public function title()
    {
        return __('Rating');
    }

    public static function getOptions()
    {
        return [
            Toggle::make('options.is_required')->label(__('Is Required')),
        ];
    }
}