From 39250bbe230034b5a6778ee9408935b459178431 Mon Sep 17 00:00:00 2001 From: Tarvo Reinpalu Date: Wed, 19 Feb 2020 18:01:54 +0200 Subject: [PATCH] Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index edf37eb..9d4d4fc 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ php artisan vendor:publish --provider="OptimistDigital\NovaSortable\ToolServiceP You can add your translations to `resources/lang/vendor/nova-sortable/` by creating a new translations file with the locale name (ie `et.json`) and copying the JSON from the existing `en.json`. -## Using on pivot table(s) +## Sorting BelongsToMany relatioship (w/ pivot table) NB! Sorting is impossible when your pivot table has multiple items with the same ID pairs. @@ -102,7 +102,7 @@ public $sortable = [ ]; ``` -Then, add sorting to the pivot query manually. On the parent model (on which the pivot's are displayed), add `orderBy()` to the pivot query definition like so: +Finally, add sorting to the pivot query manually. On the parent model (on which the pivots are displayed), add `orderBy()` to the pivot query definition like so: ``` public function products() @@ -114,8 +114,6 @@ public function products() } ``` -Now you should be able to sort the pivot models. - ## Credits - [Tarvo Reinpalu](https://github.com/Tarpsvo)