File tree Expand file tree Collapse file tree 6 files changed +52
-32
lines changed
Expand file tree Collapse file tree 6 files changed +52
-32
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,14 @@ jobs:
1111 strategy :
1212 fail-fast : false
1313 matrix :
14- php : [8.1, 8.2, 8.3]
15- laravel : [10.*, 11.*]
14+ php : [8.1, 8.2, 8.3, 8.4 ]
15+ laravel : [10.*, 11.*, 12.* ]
1616 dependency-version : [prefer-lowest, prefer-stable]
1717 exclude :
1818 - php : 8.1
1919 laravel : 11.*
20+ - php : 8.1
21+ laravel : 12.*
2022
2123 name : P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
2224
Original file line number Diff line number Diff line change @@ -3,4 +3,6 @@ composer.phar
33composer.lock
44vendor
55.php_cs.cache
6- .phpunit.result.cache
6+ .phpunit.result.cache
7+ .phpunit.cache
8+ .claude
Original file line number Diff line number Diff line change 77 }
88 },
99 "require" : {
10- "php" : " ^8.1" ,
11- "illuminate/container" : " ^10.0|^11.0" ,
12- "illuminate/database" : " ^10.0|^11.0" ,
13- "illuminate/support" : " ^10.0|^11.0" ,
10+ "php" : " ^8.1|^8.2|^8.3|^8.4 " ,
11+ "illuminate/container" : " ^10.0|^11.0|^12.0 " ,
12+ "illuminate/database" : " ^10.0|^11.0|^12.0 " ,
13+ "illuminate/support" : " ^10.0|^11.0|^12.0 " ,
1414 "spatie/laravel-query-builder" : " ^5.0"
1515 },
1616 "require-dev" : {
17- "phpunit/phpunit" : " ^9 .0" ,
18- "laravel/laravel" : " ^10.0|^11.0" ,
17+ "phpunit/phpunit" : " ^10.0|^11 .0" ,
18+ "laravel/laravel" : " ^10.0|^11.0|^12.0 " ,
1919 "mockery/mockery" : " ^1.5" ,
2020 "makeabledk/laravel-factory-enhanced" : " ^5.0" ,
2121 "fakerphp/faker" : " ^1.18"
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <phpunit backupGlobals =" false"
3- backupStaticAttributes =" false"
4- bootstrap =" vendor/autoload.php"
5- colors =" true"
6- convertErrorsToExceptions =" true"
7- convertNoticesToExceptions =" true"
8- convertWarningsToExceptions =" true"
9- processIsolation =" false"
10- stopOnFailure =" false"
11- verbose =" true"
12- >
13- <testsuites >
14- <testsuite name =" Package Test Suite" >
15- <directory suffix =" Test.php" >./tests/</directory >
16- </testsuite >
17- </testsuites >
18- <php >
19- <ini name =" display_errors" value =" 1" />
20- <server name =" APP_ENV" value =" testing" />
21- <server name =" APP_DEBUG" value =" true" />
22- <server name =" DB_CONNECTION" value =" sqlite" />
23- <server name =" DB_DATABASE" value =" :memory:" />
24- </php >
2+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" backupGlobals =" false" bootstrap =" vendor/autoload.php" colors =" true" processIsolation =" false" stopOnFailure =" false" xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory =" .phpunit.cache" backupStaticProperties =" false" >
3+ <testsuites >
4+ <testsuite name =" Package Test Suite" >
5+ <directory suffix =" Test.php" >./tests/</directory >
6+ </testsuite >
7+ </testsuites >
8+ <php >
9+ <ini name =" display_errors" value =" 1" />
10+ <server name =" APP_ENV" value =" testing" />
11+ <server name =" APP_DEBUG" value =" true" />
12+ <server name =" DB_CONNECTION" value =" sqlite" />
13+ <server name =" DB_DATABASE" value =" :memory:" />
14+ </php >
2515</phpunit >
Original file line number Diff line number Diff line change @@ -132,4 +132,27 @@ public function it_supports_circular_includes()
132132 ]],
133133 ]]);
134134 }
135+
136+ /** @test **/
137+ public function it_supports_allowed_includes_syntax ()
138+ {
139+
140+ $ server = factory (User::class)
141+ ->with (1 , 'teams ' )
142+ ->create ();
143+
144+ $ this
145+ ->withoutExceptionHandling ()
146+ ->getJson ('/servers?include=databases.server&append=databases.server.internal_ip ' )
147+ ->assertSuccessful ()
148+ ->assertJson ([[
149+ 'id ' => $ server ->id ,
150+ 'databases ' => [[
151+ 'server ' => [
152+ 'id ' => $ server ->id ,
153+ 'internal_ip ' => '127.0.0.1 ' ,
154+ ],
155+ ]],
156+ ]]);
157+ }
135158}
Original file line number Diff line number Diff line change 44
55use Makeable \ApiEndpoints \Endpoint ;
66use Makeable \ApiEndpoints \Tests \Stubs \User ;
7+ use Spatie \QueryBuilder \AllowedInclude ;
78
89class UserEndpoint extends Endpoint
910{
@@ -14,7 +15,9 @@ public function __invoke()
1415 $ this
1516 ->allowedIncludes ([
1617 'servers ' => ServerEndpoint::make (),
18+ // 'serversCount' => AllowedInclude::count('servers'),
1719 'favoriteServers ' => ServerEndpoint::make (),
20+ AllowedInclude::relationship ('teams ' ),
1821 ]);
1922 }
2023}
You can’t perform that action at this time.
0 commit comments