Skip to content

Commit 494f9ce

Browse files
authored
Update README.md
1 parent 654423f commit 494f9ce

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ sample code implement of repository, implement repository extend with basic CRUD
8989
4. implement class of service api
9090
diferent 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+
```
92100
output 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

115122
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

0 commit comments

Comments
 (0)