Skip to content

Commit

Permalink
Fix #49, update readme to include infromation about withCount sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyslik committed Nov 25, 2017
1 parent 82cbe4b commit edf380f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ In config file you can set your own separator if `.` (dot) is not what you want.

# ColumnSortable overloading (advanced)

It is possible to overload ColumnSortable relation feature, basically you can write your own join(s) / queries and apply `orderBy()` manualy.
It is possible to override ColumnSortable relation feature, basically you can write your own join(s) / queries and apply `orderBy()` manually.

See example:

Expand Down Expand Up @@ -306,7 +306,7 @@ In view just use `@sortablelink('address')`
>Huge thanks to @neutralrockets and his comments on [#8](https://github.com/Kyslik/column-sortable/issues/8). Another example on how to use overriding is issue [#41](https://github.com/Kyslik/column-sortable/issues/41#issuecomment-250895909).

# `$sortableAs` (aliasing)
# Aliasing

It is possible to declare `$sortableAs` array and use it to alias (bypass column exists check), and ignore prefixing with table.

Expand All @@ -318,7 +318,6 @@ $sortableAs = ['nick_name'];
...
```


In controller

```php
Expand All @@ -331,7 +330,11 @@ In view
```


Please see [#44](https://github.com/Kyslik/column-sortable/issues/44).
See [#44](https://github.com/Kyslik/column-sortable/issues/44) for more information on aliasing.

## Sort `withCount()`

Aliasing is useful when you want to sort results with [`withCount()`](https://laravel.com/docs/5.5/eloquent-relationships#counting-related-models), see [issue #49](https://github.com/Kyslik/column-sortable/issues/49) for more information.


# Exception to catch
Expand Down

0 comments on commit edf380f

Please sign in to comment.