Mambi
Change chart type according to the selected filter
in my chart widget i'm using this code to change the chart type according to the selected filter but it doesnt work,
any idea ?
protected function getType(): string
{
return $this->filter == 'date' ? 'line' : 'bar';
}
4 replies
Wizard no field displayed
can anyone tell me why no filed is displayed while using this simple wizard
public static function form(Form $form): Form
{
return $form
->schema([
Wizard::make([
Wizard\Step::make('step-1')
->schema([
TextInput::make('name')
->required()
]),
Wizard\Step::make('step-2')
->schema([
TextInput::make('email')
->required()
]),
Wizard\Step::make('step-2')
->schema([
TextInput::make('phone')
->required()
]),
])
]);
}
21 replies
TagsInput : Suggestions list
Hi, is there a way to reset the suggestions list of TagsInput field ?
i've a case when changing a select field i should change the the suggestions list
here's my code :
Select::make('model')
->options(['model1' => 'model1', 'model2' => 'model2'])
->afterStateUpdated(fn ($set) => $set('ids', []))
->reactive()
->required(),
Forms\Components\TagsInput::make('ids')
->suggestions(
function ($state, $get) {
if ($get('model')) {
return app()->make("App\Models\\" . $get('model'))::pluck('name', 'id');
} else
return $state;
}
)
->required(),
6 replies
Label not displayed
Hi,
i've to add an AttachAction to my form but the label of the " $action->getRecordSelect()" isn't displyed
here's my code
Tables\Actions\AttachAction::make()
->form(function ($action) {
return [
$action->getRecordSelect()->label('Player'),
Forms\Components\Select::make('sport_id')
->label('Sport')
->options(fn () => Sport::pluck('name', 'id'))
->required()
];
})
any idea ?6 replies