schema([ Forms\Components\Section::make('General') ->schema([ Forms\Components\TextInput::make('name') ->autofocus() ->required() ->maxLength(100), Forms\Components\Select::make('manager_id') ->label('Manager') ->relationship('manager', 'name') ->searchable() ->preload() ->placeholder('Select a manager') ->nullable(), Forms\Components\Group::make() ->schema([ Forms\Components\Select::make('parent_id') ->label('Parent Department') ->relationship('parent', 'name') ->preload() ->searchable() ->nullable(), Forms\Components\Textarea::make('description') ->label('Description') ->autosize() ->nullable(), ])->columns(1), ])->columns(), ]); } public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('name') ->weight('semibold') ->searchable() ->sortable(), Tables\Columns\TextColumn::make('manager.name') ->label('Manager') ->searchable() ->sortable(), ]) ->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\ListDepartments::route('/'), 'create' => Pages\CreateDepartment::route('/create'), 'edit' => Pages\EditDepartment::route('/{record}/edit'), ]; } }