How to sort resource table into latest()?

I'm trying to set the default of data of my resource table to be latest or orderByDesc but its not working
protected function getTableQuery(): Builder
{
return Activity::query()->latest();
}
protected function getTableQuery(): Builder
{
return Activity::query()->latest();
}
am I missing something?
Solution:
Or just use ->defaultSort()
Jump to solution
3 Replies
awcodes
awcodes12mo ago
parent::getTableQuery()->latest() Try that.
Solution
Dennis Koch
Dennis Koch12mo ago
Or just use ->defaultSort()
Chrysippus
Chrysippus12mo ago
thankyou Sir/s it's working now!