Shaung Bhone
Shaung Bhone
Explore posts from servers
FFilament
Created by Shaung Bhone on 2/14/2025 in #❓┊help
Value are blinking and missing in Filament Repeater
34 replies
FFilament
Created by Shaung Bhone on 2/14/2025 in #❓┊help
Value are blinking and missing in Filament Repeater
I set in here. Total amount is update without format.
->afterStateUpdated(
fn(Forms\Set $set, Forms\Get $get) =>
$set(
'total_amount',
round(collect($get('items'))
->sum(
fn($item) => (float) str_replace(
',',
'',
$item['unit_price'] ?? 0
)
), 2)
)
)
->afterStateUpdated(
fn(Forms\Set $set, Forms\Get $get) =>
$set(
'total_amount',
round(collect($get('items'))
->sum(
fn($item) => (float) str_replace(
',',
'',
$item['unit_price'] ?? 0
)
), 2)
)
)
34 replies
FFilament
Created by Shaung Bhone on 2/14/2025 in #❓┊help
Value are blinking and missing in Filament Repeater
yeah
34 replies
FFilament
Created by Shaung Bhone on 2/14/2025 in #❓┊help
Value are blinking and missing in Filament Repeater
here is my code. but I can't format the total_amout
->schema([
Forms\Components\Repeater::make('items')
->relationship()
// others code
Forms\Components\TextInput::make('unit_price')
->label('Unit Price')
->mask(RawJs::make('$money($input)'))
->stripCharacters(',')
->numeric()
->inputMode('decimal')
->required()
])
->afterStateUpdated(
fn(Forms\Set $set, Forms\Get $get) =>
$set(
'total_amount',
round(collect($get('items'))
->sum(
fn($item) => (float) str_replace(
',',
'',
$item['unit_price'] ?? 0
)
), 2)
)
)
->hiddenLabel()
->required()
->columnSpan(2),
Forms\Components\Section::make()
->hiddenLabel()
->schema([
Forms\Components\TextInput::make('total_amount')
->label('Total')
->numeric()
->inputMode('decimal')
// other code
])
])
->schema([
Forms\Components\Repeater::make('items')
->relationship()
// others code
Forms\Components\TextInput::make('unit_price')
->label('Unit Price')
->mask(RawJs::make('$money($input)'))
->stripCharacters(',')
->numeric()
->inputMode('decimal')
->required()
])
->afterStateUpdated(
fn(Forms\Set $set, Forms\Get $get) =>
$set(
'total_amount',
round(collect($get('items'))
->sum(
fn($item) => (float) str_replace(
',',
'',
$item['unit_price'] ?? 0
)
), 2)
)
)
->hiddenLabel()
->required()
->columnSpan(2),
Forms\Components\Section::make()
->hiddenLabel()
->schema([
Forms\Components\TextInput::make('total_amount')
->label('Total')
->numeric()
->inputMode('decimal')
// other code
])
])
34 replies
FFilament
Created by Shaung Bhone on 2/14/2025 in #❓┊help
Value are blinking and missing in Filament Repeater
delete live()
34 replies
FFilament
Created by Shaung Bhone on 2/14/2025 in #❓┊help
Value are blinking and missing in Filament Repeater
34 replies
FFilament
Created by Shaung Bhone on 2/14/2025 in #❓┊help
Value are blinking and missing in Filament Repeater
34 replies
FFilament
Created by Shaung Bhone on 2/12/2025 in #❓┊help
Number decimal formatting is not working
here is my update code
Forms\Components\Section::make('Expense Details')
/// other data
->disableOptionsWhenSelectedInSiblingRepeaterItems()
->searchable(),

Forms\Components\TextInput::make('unit_price')
->label('Unit Price')
->mask(RawJs::make('$money($input)'))
->stripCharacters(',')
->numeric()
->inputMode('decimal')
->required()
])
->live(debounce: 600)
->afterStateUpdated(
fn(Forms\Set $set, Forms\Get $get) =>
$set(
'total_amount',
round(collect($get('items'))
->sum(
fn($item) => (float) str_replace(
',',
'',
$item['unit_price'] ?? 0
)
), 2)
)
)
->hiddenLabel()
Forms\Components\Section::make()
->schema([
Forms\Components\TextInput::make('total_amount')
->label('Total')
->numeric()
->reactive()
->inputMode('decimal')
->readOnly()
->afterStateUpdated(
fn($state, Forms\Set $set) => $set('total_amount', number_format((float) $state, 2))
)
->required()
])->columnSpan(1)
])->columns(3),
Forms\Components\Section::make('Expense Details')
/// other data
->disableOptionsWhenSelectedInSiblingRepeaterItems()
->searchable(),

Forms\Components\TextInput::make('unit_price')
->label('Unit Price')
->mask(RawJs::make('$money($input)'))
->stripCharacters(',')
->numeric()
->inputMode('decimal')
->required()
])
->live(debounce: 600)
->afterStateUpdated(
fn(Forms\Set $set, Forms\Get $get) =>
$set(
'total_amount',
round(collect($get('items'))
->sum(
fn($item) => (float) str_replace(
',',
'',
$item['unit_price'] ?? 0
)
), 2)
)
)
->hiddenLabel()
Forms\Components\Section::make()
->schema([
Forms\Components\TextInput::make('total_amount')
->label('Total')
->numeric()
->reactive()
->inputMode('decimal')
->readOnly()
->afterStateUpdated(
fn($state, Forms\Set $set) => $set('total_amount', number_format((float) $state, 2))
)
->required()
])->columnSpan(1)
])->columns(3),
8 replies
FFilament
Created by Shaung Bhone on 2/12/2025 in #❓┊help
Number decimal formatting is not working
Not working
8 replies
FFilament
Created by Shaung Bhone on 2/12/2025 in #❓┊help
Number decimal formatting is not working
let me check. Thank you
8 replies
FFilament
Created by galli.roberto on 12/20/2024 in #❓┊help
Action Modal - inside user menu
7 replies
FFilament
Created by galli.roberto on 12/20/2024 in #❓┊help
Action Modal - inside user menu
Not yet I think you can't render action in the blade render. Try another approach or sth.
7 replies
FFilament
Created by galli.roberto on 12/20/2024 in #❓┊help
Action Modal - inside user menu
7 replies
FFilament
Created by Shaung Bhone on 10/13/2024 in #❓┊help
url() validation gives me valid url
How can I validate for that case?
4 replies
FFilament
Created by Shaung Bhone on 10/13/2024 in #❓┊help
url() validation gives me valid url
https://www.nike.com/th/t/รองเท้าผู้-air-force-1-07-WrLlWX/CW2288-111?cp=11357671355_search_%7Cth%7CPMax:+TH+-+Smart+Shopping+-+Brand%7C%7CGOOGLE&gad_source=1&gbraid=0AAAAADLM_Zk46u-Ws6BnF93pFK2j4QcT2&gclid=CjwKCAjwvKi4BhABEiwAH2gcw_7jvIHZETI4DRxbYgnEU-OJKRqKfsLhXmYoGHsVNDw_tqUd6_Q5PhoCenEQAvD_BwE&gclsrc=aw.ds
https://www.nike.com/th/t/รองเท้าผู้-air-force-1-07-WrLlWX/CW2288-111?cp=11357671355_search_%7Cth%7CPMax:+TH+-+Smart+Shopping+-+Brand%7C%7CGOOGLE&gad_source=1&gbraid=0AAAAADLM_Zk46u-Ws6BnF93pFK2j4QcT2&gclid=CjwKCAjwvKi4BhABEiwAH2gcw_7jvIHZETI4DRxbYgnEU-OJKRqKfsLhXmYoGHsVNDw_tqUd6_Q5PhoCenEQAvD_BwE&gclsrc=aw.ds
4 replies
FFilament
Created by Shaung Bhone on 10/12/2024 in #❓┊help
Best approach to save "price" field
do not use format
11 replies
FFilament
Created by Shaung Bhone on 10/12/2024 in #❓┊help
Best approach to save "price" field
used format
11 replies
FFilament
Created by Shaung Bhone on 10/12/2024 in #❓┊help
Best approach to save "price" field
Both are decimal
11 replies
FFilament
Created by Shaung Bhone on 10/12/2024 in #❓┊help
Best approach to save "price" field
No description
11 replies
FFilament
Created by Shaung Bhone on 10/12/2024 in #❓┊help
Best approach to save "price" field
No description
11 replies