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');
}),
];
}
}