© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•5mo ago•
14 replies
Eskie

Dynamic Form Inside Repeater isn't reactive

Select::make('type')
    ->required()
    ->default(QrContentType::Text)
    ->options(QrContentType::class)
    ->live(),
Repeater::make('payload')
    ->hiddenLabel()
    ->schema(function (Get $get) {
        /** @var QrContentType $type */
        $type = $get('type') ?? QrContentType::Text;

        return $type->toForm();
    })
    ->deletable(false)
    ->addable(false)
    ->reorderable(false)
    ->live(),
Select::make('type')
    ->required()
    ->default(QrContentType::Text)
    ->options(QrContentType::class)
    ->live(),
Repeater::make('payload')
    ->hiddenLabel()
    ->schema(function (Get $get) {
        /** @var QrContentType $type */
        $type = $get('type') ?? QrContentType::Text;

        return $type->toForm();
    })
    ->deletable(false)
    ->addable(false)
    ->reorderable(false)
    ->live(),

class UrlSchema
{
    /**
     * @return array<int, Field>
     */
    public static function getForm(): array
    {
        return [
            Toggle::make('is_dynamic_qr')
                ->live()
                ->afterStateUpdated(function () {
                    \Log::debug(Str::random());
                })
                ->helperText('Enabling this will create a QR code that points to an internal short link, which will redirect to any specified link, dynamically. Once you generate the QR code, make sure to never update the short link alias, or else the QR will stop working.'),
            TextInput::make('link')
                ->required()
                ->hidden(fn (Get $get) => $get('is_dynamic_qr')),
            Select::make('link')
                ->required()
                ->visible(function (Get $get) {
                    \Log::debug($get('payload'));
                    \Log::debug($get('is_dynamic_qr'));

                    return $get('is_dynamic_qr');
                }),
        ];
    }
}
class UrlSchema
{
    /**
     * @return array<int, Field>
     */
    public static function getForm(): array
    {
        return [
            Toggle::make('is_dynamic_qr')
                ->live()
                ->afterStateUpdated(function () {
                    \Log::debug(Str::random());
                })
                ->helperText('Enabling this will create a QR code that points to an internal short link, which will redirect to any specified link, dynamically. Once you generate the QR code, make sure to never update the short link alias, or else the QR will stop working.'),
            TextInput::make('link')
                ->required()
                ->hidden(fn (Get $get) => $get('is_dynamic_qr')),
            Select::make('link')
                ->required()
                ->visible(function (Get $get) {
                    \Log::debug($get('payload'));
                    \Log::debug($get('is_dynamic_qr'));

                    return $get('is_dynamic_qr');
                }),
        ];
    }
}
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Repeater Inside Repeater
FilamentFFilament / ❓┊help
7mo ago
Reactive Behavior Not Working for Fields Inside Repeater
FilamentFFilament / ❓┊help
14mo ago
Dynamic Repeater
FilamentFFilament / ❓┊help
3y ago
Dynamic Repeater
FilamentFFilament / ❓┊help
3y ago