Sortable with nested relations

How can I use sortable with multiple relations?
        return $table
            ->columns([
                //
                Tables\Columns\TextColumn::make('type.year.name')->label('Année')->sortable(),
                Tables\Columns\TextColumn::make('type.name')->label('Type')->sortable(),
                Tables\Columns\TextColumn::make('name')->label('Region')->sortable(),
                Tables\Columns\TextColumn::make('description'),
            ])

when I try to sort type.year.name it gives me :
Column not found: 1054 Unknown column 'pk_types.year_id'
which is normal because there's no column year_id in table regions
Was this page helpful?