File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,14 @@ sample code implement of repository, implement repository extend with basic CRUD
89894 . implement class of service api
9090diferent implement service with implement service api only on extend class
9191![ implement class api] ( https://res.cloudinary.com/dk0053zbe/image/upload/v1657282469/easy-repository/class-service-api_dcxrop.png )
92+
93+ 5 . on your controller need call ->toJson() end of method service to auto generate response json from ServiceApi extends class
94+ ``` php
95+ public function methodNameOnController() {
96+ return $this->nameOfService->methodOfService()->toJson();
97+ }
98+
99+ ```
92100output or response with extend ServiceApi, more detail you can read code on ServiceApi
93101```
94102```json
@@ -109,7 +117,6 @@ output or response with extend ServiceApi, more detail you can read code on Serv
109117}
110118```
111119
112-
113120## Changelog
114121
115122Please see [ CHANGELOG] ( CHANGELOG.md ) for more information on what has changed recently.
You can’t perform that action at this time.
0 commit comments