Skip to content

Commit d510de6

Browse files
Update README.md
1 parent ef83fdb commit d510de6

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,10 @@ You can also update, re-arrange (for one-to-many relationships), and delete rela
6767

6868
![Rearrange Models](https://raw.githubusercontent.com/kirschbaum-development/nova-inline-relationship/master/screenshots/UpdateView.png "Rearrange Models")
6969

70-
To rearrange a model you should specify an `integer` field which will be used to sort models. For example, in the following code we will use a field named `weight` to store the sorting order for `Images`.
70+
You can add drag and drop functionality for related models to update their order by using the `sortUsing()` method. In the following code example we use a field named `order` to store the sort order for the `Images` model:
7171

7272
```php
73-
HasMany::make('Images', 'images', Image::class)->inline()->sortUsing('weight'),
74-
```
73+
HasMany::make('Images')->inline()->sortUsing('order'),
7574

7675

7776
## Required Relationships

0 commit comments

Comments
 (0)