Get all the table columns from a resource

Would there be way to get all the columns from a resource?
Solution
protected function getResourceTableColumns(): array
{
    $livewire = app('livewire')->new(ListRecords::class);

    return YourResource::table(new Table($livewire))->getColumns();
}
Was this page helpful?