Custom hierarchical (tree) table - filament or custom row by row?
I am trying to build a hierarchical table that will include row grouping, collapsing and expanding groups (tree structure). One of the columns must contain textinput, at the end of the table a submit button to save changes.
The package https://github.com/staudenmeir/laravel-adjacency-list is very helpful here.
I am doing tests with database queries and with this package I can easily build a tree structure in plain HTML.
Trying to do this in the Filament table but right at the beginning I have a problem because I can't use the query->(Product::find($product_id)->descendants) because package generate ready to use collection, so there is an error (query must be Builder|Closure|null, Collection given)
Question 1. How to get around the error to be able to use the filament table?
Question 2. It is possible that the best way, however, would be to build such a table outside the filament, with loop, row by row. How to do it to use filament components (table with grouping/collapse/expansion)?. Is there somewhere an example of building such a custom table (I can't find)?
The package https://github.com/staudenmeir/laravel-adjacency-list is very helpful here.
I am doing tests with database queries and with this package I can easily build a tree structure in plain HTML.
Trying to do this in the Filament table but right at the beginning I have a problem because I can't use the query->(Product::find($product_id)->descendants) because package generate ready to use collection, so there is an error (query must be Builder|Closure|null, Collection given)
Question 1. How to get around the error to be able to use the filament table?
Question 2. It is possible that the best way, however, would be to build such a table outside the filament, with loop, row by row. How to do it to use filament components (table with grouping/collapse/expansion)?. Is there somewhere an example of building such a custom table (I can't find)?
GitHub
Recursive Laravel Eloquent relationships with CTEs - GitHub - staudenmeir/laravel-adjacency-list: Recursive Laravel Eloquent relationships with CTEs