Skip to content

4.10.2

Choose a tag to compare

@binaryk binaryk released this 11 Feb 11:07
· 26 commits to 4.x since this release
5515263

Fixed

  • Sorting using BelongsTo field type. So now you can have:
// PostRepository

public static function sorts(): array
{
  return [
            'users.attributes.name' => SortableFilter::make()->setColumn('users.name')->usingBelongsTo(
                BelongsTo::make('user', 'user', UserRepository::class),
            )
 ];
}

And frontend can filter your posts by users.name using:

api/restify/posts?sort=users.attributes.name.