-
-
Notifications
You must be signed in to change notification settings - Fork 358
Closed
Labels
bugSomething isn't workingSomething isn't workingwontfixThis will not be worked onThis will not be worked on
Description
What happened?
It seems that the relation of type BelongsToMany is not supported in the builder method:
public function builder(): Builder
In fact, debugging the code i can see in Rappasoft\LaravelLivewireTables\Traits\WithData
protected function getTableForColumn(Column $column): ?string
{
$table = null;
$lastQuery = clone $this->getBuilder();
foreach ($column->getRelations() as $relationPart) {
$model = $lastQuery->getRelation($relationPart);
if ($model instanceof HasOne || $model instanceof BelongsTo || $model instanceof MorphOne) {
$table = $this->getTableAlias($table, $relationPart);
}
$lastQuery = $model->getQuery();
}
return $table;
}
It seems that if i have a BelongsToMany relation, what i get is the data of the model of the query
How to reproduce the bug
No response
Package Version
^3.5
PHP Version
8.3
None
Laravel Version
v11.12.0
No response
Alpine Version
No response
Theme
None
Notes
No response
Error Message
Rappasoft\LaravelLivewireTables\Views\Column::setTable(): Argument #1 ($table) must be of type string, null given, called in /var/www/html/portal/vendor/rappasoft/laravel-livewire-tables/src/Traits/Helpers/ColumnHelpers.php on line 43
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingwontfixThis will not be worked onThis will not be worked on