https://twill.io logo
I'm trying to sort the table rows with a scope and...
# ❓questions
n
I'm trying to sort the table rows with a scope and the order function in the repository, I believe this simple scope should be good, but it just clears the table rows when clicking on sorting
Copy code
public function scopeOrderByCreatedAtFormatted($query, $direction = 'asc')
    {
        return $query
            ->select('blog_post_comments.created_at')
            ->where('blog_post_comments.created_at')
            ->orderBy('blog_post_comments.created_at', $direction);
    }
What else do I need? I tried setting up 'relationship' key in the indexColumns, but it just breaks everything.