Skip to content

Commit

Permalink
Update CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarpsvo committed Jul 19, 2019
1 parent 3868f34 commit 7c6814a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.1] - 2019-07-19

### Changed

- Order menu items by 'order' value by [@kaareloun](https://github.com/kaareloun)

## [1.3.0] - 2019-06-13

### Added
Expand Down Expand Up @@ -91,6 +97,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Nesting and re-ordering of menu-items
- Creation of custom link options (ie links to Laravel models)

[1.3.1]: https://github.com/optimistdigital/nova-menu-builder/compare/1.3.0...1.3.1
[1.3.0]: https://github.com/optimistdigital/nova-menu-builder/compare/1.2.1...1.3.0
[1.2.1]: https://github.com/optimistdigital/nova-menu-builder/compare/1.2.0...1.2.1
[1.2.0]: https://github.com/optimistdigital/nova-menu-builder/compare/1.1.4...1.2.0
Expand Down
6 changes: 3 additions & 3 deletions src/Models/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public function rootMenuItems()
return $this
->hasMany(MenuItem::class)
->where('parent_id', null)
->orderby('parent_id')
->orderby('order')
->orderby('name');
->orderBy('parent_id')
->orderBy('order')
->orderBy('name');
}

public function formatForAPI()
Expand Down
2 changes: 1 addition & 1 deletion src/Models/MenuItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function menu()

public function children()
{
return $this->hasMany(self::class, 'parent_id')->with('children')->orderby('order');
return $this->hasMany(self::class, 'parent_id')->with('children')->orderBy('order');
}

public function itemsChildren($parentId)
Expand Down

0 comments on commit 7c6814a

Please sign in to comment.