@@ -9,8 +9,8 @@ customize this order, you must add an `order` attribute on your ApiResource anno
99
1010``` php
1111<?php
12- // api/src/Entity /Book.php
13- namespace App\Entity ;
12+ // api/src/ApiResource /Book.php with Symfony or app/ApiResource/Book.php with Laravel
13+ namespace App\ApiResource ;
1414
1515use ApiPlatform\Metadata\ApiResource;
1616
@@ -30,7 +30,8 @@ class Book
3030
3131``` yaml
3232# api/config/api_platform/resources/Book.yaml
33- App\Entity\Book :
33+ # The YAML syntax is only supported for Symfony
34+ App\ApiResource\Book :
3435 order :
3536 foo : ASC
3637` ` `
@@ -44,8 +45,8 @@ If you only specify the key, `ASC` direction will be used as default. For exampl
4445
4546` ` ` php
4647<?php
47- // api/src/Entity /Book.php
48- namespace App\E ntity ;
48+ // api/src/ApiResource /Book.php with Symfony or app/ApiResource/Book.php with Laravel
49+ namespace App\A piResource ;
4950
5051use ApiPlatform\M etadata\A piResource;
5152
@@ -70,7 +71,8 @@ class Book
7071
7172` ` ` yaml
7273# api/config/api_platform/resources/Book.yaml
73- App\E ntity\B ook:
74+ # The YAML syntax is only supported for Symfony
75+ App\A piResource\B ook:
7476 order: ['foo', 'bar']
7577` ` `
7678
@@ -82,8 +84,8 @@ It's also possible to configure the default order on an association property:
8284
8385` ` ` php
8486<?php
85- // api/src/Entity /Book.php
86- namespace App\E ntity ;
87+ // api/src/ApiResource /Book.php with Symfony or app/ApiResource/Book.php with Laravel
88+ namespace App\A piResource ;
8789
8890use ApiPlatform\M etadata\A piResource;
8991
@@ -103,7 +105,8 @@ class Book
103105
104106` ` ` yaml
105107# api/config/api_platform/resources/Book.yaml
106- App\E ntity\B ook:
108+ # The YAML syntax is only supported for Symfony
109+ App\A piResource\B ook:
107110 order: ['author.username']
108111` ` `
109112
@@ -115,8 +118,8 @@ Another possibility is to apply the default order for a specific collection oper
115118
116119` ` ` php
117120<?php
118- // api/src/Entity /Book.php
119- namespace App\E ntity ;
121+ // api/src/ApiResource /Book.php with Symfony or app/ApiResource/Book.php with Laravel
122+ namespace App\A piResource ;
120123
121124use ApiPlatform\M etadata\G etCollection;
122125use ApiPlatform\M etadata\A piResource;
@@ -141,7 +144,8 @@ class Book
141144
142145` ` ` yaml
143146# api/config/api_platform/resources/Book.yaml
144- App\E ntity\B ook:
147+ # The YAML syntax is only supported for Symfony
148+ App\A piResource\B ook:
145149 ApiPlatform\M etadata\G etCollection: ~
146150 get_desc_custom:
147151 class: ApiPlatform\M etadata\G etCollection
0 commit comments