Gojim/Paul
Gojim/Paul
Explore posts from servers
FFilament
Created by Gojim/Paul on 10/21/2024 in #❓┊help
How can i update field Information when reactive doesnt work
I am very grateful to you. I tried around here for days and couldn't solve it. Thank you
13 replies
FFilament
Created by Gojim/Paul on 10/21/2024 in #❓┊help
How can i update field Information when reactive doesnt work
No description
13 replies
FFilament
Created by Gojim/Paul on 10/21/2024 in #❓┊help
How can i update field Information when reactive doesnt work
No description
13 replies
FFilament
Created by Gojim/Paul on 10/21/2024 in #❓┊help
How can i update field Information when reactive doesnt work
Hey, its works 😄
13 replies
FFilament
Created by Gojim/Paul on 10/21/2024 in #❓┊help
How can i update field Information when reactive doesnt work
OK, I'll try it tomorrow morning. Is it ok if I report back here again?
13 replies
FFilament
Created by Gojim/Paul on 10/21/2024 in #❓┊help
How can i update field Information when reactive doesnt work
Thank you for your answer. Is there another way to dynamically reload the data? So far I have only ever found a reference to a custom component, but there must be a way to load the data dynamically via a backend controller logic. Would you have an idea?
13 replies
FFilament
Created by Gojim/Paul on 10/21/2024 in #❓┊help
How can i update field Information when reactive doesnt work
Select::make('item_id') ->label('Artikel') ->options(Item::query()->pluck('name', 'id')) ->required() ->reactive() ->columnSpan([ 'md' => 5, 'lg' => 2, ]) ->afterStateUpdated(fn ($state, Set $set) => $set('price', Item::find($state)?->price ?? 0)) ->afterStateUpdated(function (Get $get, Set $set, $state) { $set('date_range', null); self::updateTotals($get, $set); }) ->searchable(), DateRangePicker::make('date_range') ->label('Buchungszeitraum') ->required() ->autoApply() ->columnSpan([ 'lg' => 3, ]) ->disabledDates(function (Get $get) { $disabledDates = []; $itemId = $get('item_id'); if ($itemId) { $bookings = BookingPosition::where('item_id', $itemId)->get(); foreach ($bookings as $booking) { $fromDate = \Carbon\Carbon::parse($booking->from_date); $toDate = \Carbon\Carbon::parse($booking->to_date); $period = \Carbon\CarbonPeriod::create($fromDate, $toDate); foreach ($period as $date) { $disabledDates[] = $date->format('Y-m-d'); } } } return $disabledDates; })
13 replies
FFilament
Created by Gojim/Paul on 10/17/2024 in #❓┊help
DateRangePicker - disabledDates()
No description
4 replies
FFilament
Created by Gojim/Paul on 10/17/2024 in #❓┊help
DateRangePicker - disabledDates()
CodeSnippet from DateRangePicker:
4 replies