Section::make('Gestion de la durée')
->icon('carbon-time')
->columns(2)
->schema([
TextInput::make('duration')
->requiredUnless('price_quotation', true)
->label('Durée (minutes)')
->numeric()
->hidden(
fn (Get $get): bool => $get('duration_quotation') == true
),
TextInput::make('max_duration')
->label('Durée (fourchette haute)')
->numeric()
->hidden(
fn (Get $get): bool => $get('duration_quotation') == true
),
Toggle::make('duration_quotation')
->label('Durée variable')
->reactive()
->afterStateUpdated(
fn ($state, callable $set) => $state
? $set('duration', null)
: $set('duration', 'hidden'),
),
]),
Section::make('Gestion de la durée')
->icon('carbon-time')
->columns(2)
->schema([
TextInput::make('duration')
->requiredUnless('price_quotation', true)
->label('Durée (minutes)')
->numeric()
->hidden(
fn (Get $get): bool => $get('duration_quotation') == true
),
TextInput::make('max_duration')
->label('Durée (fourchette haute)')
->numeric()
->hidden(
fn (Get $get): bool => $get('duration_quotation') == true
),
Toggle::make('duration_quotation')
->label('Durée variable')
->reactive()
->afterStateUpdated(
fn ($state, callable $set) => $state
? $set('duration', null)
: $set('duration', 'hidden'),
),
]),