jajla
jajla
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
No description
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
DatePicker::make('date') ->minDate(now()->format($dateFormat)) //->native(false) ->required() ->formatStateUsing(fn($state) => Carbon::parse($state) ->translatedFormat('j F l')) ->live(),
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
🤣
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
thanks for me its magic
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
thank you your help means a lot to me
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
Can you explain to me what I had wrong?
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
it work
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
No description
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
this $availableTimes = $times->filter(function ($time) use ($reservations) { return ! in_array($time, $reservations); })->toArray();?
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
No description
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
No description
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
I'll check when I get home
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
Data is in database
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
Yes and that dont work that hour is still present
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
I want to hide the hours that are already registered for a given day
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
I make UserVisitService this is the code public function getAvailableTimesForDate(string $date): array { $date = Carbon::parse($date); $startPeriod = $date->copy()->hour(9); $endPeriod = $date->copy()->hour(18); $times = CarbonPeriod::create($startPeriod, '30 minutes', $endPeriod); $availableReservations = []; $reservations = Visit::whereDate('date', $date) ->pluck('time') ->toArray(); $availableTimes = $times->filter(function ($time) use ($reservations) { return ! in_array($time, $reservations); })->toArray(); foreach ($availableTimes as $time) { $key = $time->format('H:i'); $availableReservations[$key] = $time->format('H:i'); } return $availableReservations; } And UserVisitResource public static function form(Form $form): Form { $dateFormat = 'Y-m-d'; return $form ->schema([ DatePicker::make('date') ->minDate(now()->format($dateFormat)) ->required() ->live(), Radio::make('time') ->options(fn(Get $get) => (new UserVisitService())->getAvailableTimesForDate($get('date'))) ->hidden(fn(Get $get) => !$get('date')) ->required() ->columnSpan(2), Select::make('service_type') ->label(__('trans.form.service_type')) ->options( collect(Services::cases()) ->mapWithKeys(fn($role) => [$role->value => $role->getLabel()]) ->toArray() )->required(), ]); }
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
I tried the method from the link but it doesn't work for me, the hour disappears after it is already booked
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
Thanks
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
43 replies
FFilament
Created by jajla on 2/12/2025 in #❓┊help
Is it possible to generate future dates in Filament
because in the model I made a loop that iterated over the date from today to, for example, the date in 7 days and it called these days but I don't know how to use it in the table in filament
43 replies