public function getForms(): array { return [ 'form' => $this->form( $this->makeForm()->schema([ Grid::make([ 'default' => 1, 'sm' => 2, 'md' => 3, 'lg' => 4, 'xl' => 6, '2xl' => 8, ]) ->schema([ DateRangePicker::make('start_date') ->hiddenLabel() ->helperText('When?') ->placeholder('Choose date') ->extraAttributes([ 'helper-position' => 'above', 'class' => 'helper-above', ]) ->reactive(), // View::make('components.vertical-divider')->columnSpan(0.05)->extraAttributes(['class' => 'client-form-divider-view']), TimePicker::make('start_time') ->hiddenLabel() ->placeholder('Choose Time') ->default('09:00') ->seconds(false) ->helperText('Start time?') ->extraAttributes([ 'helper-position' => 'above', 'class' => 'client-form-input helper-above', ]) ->reactive(), // View::make('components.vertical-divider')->columnSpan(0.05)->extraAttributes(['class' => 'client-form-divider-view']), TextInput::make('number_of_students') ->hiddenLabel() ->numeric() ->default(1) ->minValue(1) ->placeholder('Number #of Students') ->helperText('How many?') ->extraAttributes([ 'helper-position' => 'above', 'class' => 'client-form-input helper-above', ]) ->reactive(), // View::make('components.vertical-divider')->columnSpan(0.05)->extraAttributes(['class' => 'client-form-divider-view']), Select::make('instructor_id') ->hiddenLabel() ->options(function () { return \App\Models\User::whereHas('roles', function ($query) { $query->where('name', BaseRolesEnum::INSTRUCTOR->value); })->where('instructor_status', InstructorStatusEnum::APPROVED->value)->get()->mapWithKeys(function ($user) { return [$user->id => "{$user->forename} {$user->surname}"]; })->toArray(); }) ->searchable() ->placeholder('Choose instructor') ->helperText('Who?') ->extraAttributes([ 'helper-position' => 'above', 'class' => 'client-form-input helper-above', ]) ->reactive(), Actions::make([ // Action::make('check_availibility') // ->label('Check Availability') // ->action('check') // ->extraAttributes(['type' => 'submit', 'class' => 'client__button client__button--primary']), Action::make('reset')->label('Reset Details') ->action(fn() => $this->reset('data')) ->extraAttributes(['class' => 'client__button client__button--secondary']), ]) ->alignEnd() ->verticallyAlignEnd() ->columnStart(8) ->columnSpan(1), ]), ])->statePath('data') )->columns([ 'default' => 1, 'sm' => 2, 'md' => 3, 'lg' => 4, 'xl' => 6, '2xl' => 8, ]), ]; }