Closed EmilMoe closed 7 months ago
I figured it can be done in the controller, but still interested if it's possible with a Table class.
'table' => SpladeTable::for(Model::where('parent', $id))
Hi!
You may use the Table class' constructor by creating an instance.
In the controller:
$myTable = new TableClass($groupId);
In the table class:
public function __construct(private $groupId) {}
And you may now use the property $groupId
inside the table class.
Description:
How can I display a table on a sub page for a group, where I only want a subgroup from the table to be displayed? I don't see a way to pass any parameters to the table class.
Documentation says:
But not how the right way should be then.
https://splade.dev/docs/table-overview
Preferably there would be some attributes.
Steps To Reproduce Issue:
Creating a dynamically scoped table.