Skip to content

Commit d00b49a

Browse files
committed
Update the schema stub to use iterable types for the fields and filters methods, enhancing type consistency and clarity. Additionally, include the Filter contract for improved functionality.
1 parent 8ca4282 commit d00b49a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

stubs/schema.stub

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace {{ namespace }};
44

55
use {{ namespacedModel }};
6+
use LaravelJsonApi\Eloquent\Contracts\Filter;
67
use LaravelJsonApi\Eloquent\Contracts\Paginator;
78
use LaravelJsonApi\Eloquent\Fields\DateTime;
89
use LaravelJsonApi\Eloquent\Fields\ID;
@@ -23,9 +24,9 @@ class {{ class }} extends {{ schema }}
2324
/**
2425
* Get the resource fields.
2526
*
26-
* @return array
27+
* @return iterable
2728
*/
28-
public function fields(): array
29+
public function fields(): iterable
2930
{
3031
return [
3132
ID::make(),
@@ -37,9 +38,9 @@ class {{ class }} extends {{ schema }}
3738
/**
3839
* Get the resource filters.
3940
*
40-
* @return array
41+
* @return iterable<Filter>
4142
*/
42-
public function filters(): array
43+
public function filters(): iterable
4344
{
4445
return [
4546
WhereIdIn::make($this),

0 commit comments

Comments
 (0)