schema([ Forms\Components\Wizard::make([ Forms\Components\Wizard\Step::make('Question Info') ->schema([ Forms\Components\TextInput::make('question') ->label('Question') ->required(), Forms\Components\Select::make('question_type') ->options([ 'text' => 'Text Question', 'image' => 'Image Question', ]) ->required() ->default('text') ->live(), Forms\Components\Select::make('level') ->options([ 'very_easy' => 'Very Easy', 'easy' => 'Easy', 'medium' => 'Medium', 'hard' => 'Hard', 'very_hard' => 'Very Hard', ]) ->default('easy'), ]), Forms\Components\Wizard\Step::make('Question Content') ->schema([ // Text answers Forms\Components\Section::make('Answers') ->schema([ Forms\Components\TextInput::make('answer_1')->required(), Forms\Components\TextInput::make('answer_2')->required(), Forms\Components\TextInput::make('answer_3')->required(), Forms\Components\TextInput::make('answer_4')->required(), Forms\Components\Select::make('correct_answer') ->options([ 'answer_1' => 'Answer 1', 'answer_2' => 'Answer 2', 'answer_3' => 'Answer 3', 'answer_4' => 'Answer 4', ]) ->required() ->default('answer_1') ->columnSpanFull(), ]) ->columns(2) ->visible(fn(Get $get) => $get('question_type') === 'text'), // Image upload Forms\Components\FileUpload::make('image') ->label('Image') ->directory('question_game_images') ->image() ->disk('public') ->columnSpanFull() ->downloadable(true) ->openable() ->visible(fn(Get $get) => $get('question_type') === 'image'), ]), ])->columnSpanFull() ]); } public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('question') ->searchable(), Tables\Columns\TextColumn::make('question_type') ->searchable(), Tables\Columns\TextColumn::make('level') ->searchable(), Tables\Columns\TextColumn::make('created_at') ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) ->filters([ // ]) ->actions([ Tables\Actions\EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => Pages\ListQuestionGameQuestions::route('/'), 'create' => Pages\CreateQuestionGameQuestion::route('/create'), 'edit' => Pages\EditQuestionGameQuestion::route('/{record}/edit'), ]; } }