For the complete documentation index, see llms.txt. This page is also available as Markdown.

Sorting

Sorting Comments

Available Options: All the options in LakM\Commenter\Enums\Sort class.

  • Sort::TOP - Sort by custom algorithm (default).

  • Sort::LATEST - Sort by latest comments.

  • Sort::OLDEST - Sort by oldest comments.

  • Sort::REPLIES - Sort by replies count

Overwrite default sort order

Globally

Change the default_sort option in commenter.config file.

// commenter.config

use LakM\Commenter\Enums\Sort;

return [
    // Default comments sort order, See Sort::class for available values
    'default_sort' => Sort::TOP,
];

Model-wise (Higher priority)

Define variable $commmentsSortOrder and set the value in commentable model.

Sorting Replies

Available Options: Following options in LakM\Commenter\Enums\Sort class.

  • Sort::LATEST - Sort by latest comments.

  • Sort::OLDEST - Sort by oldest comments.

Overwrite default sort order

Globally

Change the reply.default_sort option in comments.config file.

Model-wise (Higher priority)

Define variable $repliesSortOrder and set the value in commentable model.

Was this helpful?