Help with Table Builder (Livewire) and passing in data

I see there is a query() method, but suppose I already have a Collection of results. How do I output that into the table?
php public Project $project;

public function mount(Project $project)
{
$this->project = $project;
}

public function table(Table $table): Table
{
return $table
->query($this->project->testcases())
->columns([
TextColumn::make('name')
->searchable(),
// TextColumn::make('section.name')
// ->searchable()

])
->filters([])
->actions([])
->bulkActions([]);
}
php public Project $project;

public function mount(Project $project)
{
$this->project = $project;
}

public function table(Table $table): Table
{
return $table
->query($this->project->testcases())
->columns([
TextColumn::make('name')
->searchable(),
// TextColumn::make('section.name')
// ->searchable()

])
->filters([])
->actions([])
->bulkActions([]);
}
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server