8000 Add configuration options · m-bymike/laravel-json-api@e62094a · GitHub
[go: up one dir, main page]

Skip to content

Commit e62094a

Browse files
committed
Add configuration options
1 parent 0654066 commit e62094a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

config/json-api.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,37 @@
143143
*/
144144
'adapters' => [],
145145

146+
/*
147+
|--------------------------------------------------------------------------
148+
| Generators
149+
|--------------------------------------------------------------------------
150+
|
151+
| With this package comes a set of handy generators. Which makes it possible
152+
| to easily generate every class needed to implement an api resource.
153+
|
154+
| To smoothen out any rough edges, without enforcing any specific patterns
155+
| we have included a few handy configuration options, so that the generators
156+
| can follow your workflow.
157+
|
158+
| `namespace` = The folder in which you will be storing everyting
159+
| related to LaravelJsonApi.
160+
| (default: 'JsonApi')
161+
|
162+
| 'by_resource` = Whether the generated classes should group by resource
163+
| name or not.
164+
| Choose:
165+
| - true (default)
166+
| e.g. \App\JsonApi\Tasks\{Schema, Request, Hydrator}
167+
| - false
168+
| e.g. \App\JsonApi\Schemas\{User, Post, Comment}
169+
| e.g. \App\JsonApi\Requests\{User, Post, Comment}
170+
|
171+
| `use_eloquent` = Whether you are using Eloquent ORM in this app.
172+
| (default: true)
173+
*/
174+
'generator' => [
175+
'namespace' => 'JsonApi',
176+
'by_resource' => true,
177+
'use_eloquent' => true,
178+
]
146179
];

0 commit comments

Comments
 (0)
0