Skip to content

Commit 43ed5be

Browse files
committed
change readme md
1 parent 843bc77 commit 43ed5be

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,28 @@ you can override basic method crud for re-write code logic
7676

7777

7878
## Example code
79-
1. Repository
80-
2. Service
81-
3. Service Api
79+
1. Controller <br>
80+
you can call interface of service with automatic injection depedency [read more detail](https://laravel.com/docs/9.x/container#automatic-injection)
81+
![sample controller](https://res.cloudinary.com/dk0053zbe/image/upload/v1657282450/easy-repository/user-controller_vykrwc.png)
82+
controller only call interface of service not class implement of service
83+
2. Service <br>
84+
sample in interface of service, the interface bind to class implementation
85+
![sample interface service](https://res.cloudinary.com/dk0053zbe/image/upload/v1657282435/easy-repository/user-interface_hicrrc.png)
86+
sample code in class implementation
87+
![sample class implement service](https://res.cloudinary.com/dk0053zbe/image/upload/v1657282457/easy-repository/user-service_dmudfs.png)
88+
class implement service only call interface of repository with automatic injection depedency
89+
, service not recommended direct call method on class implement of repository
90+
3. Repository <br>
91+
sample interface of repository
92+
![sample interface repository](https://res.cloudinary.com/dk0053zbe/image/upload/v1657282449/easy-repository/interface-repository_wqxhp6.png)
93+
sample code implement of repository, implement repository extend with basic CRUD query logic
94+
![sample implement repository](https://res.cloudinary.com/dk0053zbe/image/upload/v1657282450/easy-repository/class-implement_fsa36d.png)
95+
96+
4. implement class of service api
97+
diferent implement service with implement service api only on extend class
98+
![implement class api](https://res.cloudinary.com/dk0053zbe/image/upload/v1657282469/easy-repository/class-service-api_dcxrop.png)
99+
output or response with extend ServiceApi, more detail you can read code on ServiceApi
82100
```
83-
- output or response like this if service implement extend ServiceApi class
84101
```json
85102
{
86103
"success": true,
@@ -99,6 +116,7 @@ you can override basic method crud for re-write code logic
99116
}
100117
```
101118

119+
102120
## Changelog
103121

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

0 commit comments

Comments
 (0)