File tree 1 file changed +10
-3
lines changed 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -19,23 +19,30 @@ In `config/app.php` at 'providers' add:
19
19
20
20
` php artisan make:repo {modelName} `
21
21
22
- This creates a new repo in app/Repository
23
- Ex: ` php artisan make:repo Product ` will create ` app/Repository /ProductRepository.php `
22
+ This creates a new repo in app/Repositories
23
+ Ex: ` php artisan make:repo Product ` will create ` app/Repositories /ProductRepository.php `
24
24
25
25
in constructor of ` ProductRepository.php ` the model will be setup to use
26
26
` App\Models\Product ` and ` $this->model = $model ` ` $model ` being the instance of Product.
27
27
28
28
` php artisan make:service {serviceName} `
29
29
30
- This creates a new service in app/Service
30
+ This creates a new service in app/Services
31
31
ex: ` php artisan make:repo ProductSearch ` will create ` app/Service/ProductSearchService.php `
32
32
33
+ ` php artisan make:logic {modelName} `
34
+ This creates a new service in app/Services and a new repo in app/Repositories
35
+ Ex: ` php artisan make:logic Product ` will create ` app/Repositories/ProductRepository.php ` and ` app/Services/ProductService.php `
36
+
33
37
in the constructor of 'ProductSearchService.php` you can inject all the repositories you need
34
38
in order to perform the business logic you want.
35
39
36
40
` ProductSearchService ` can be injected in methods of a controller, command or other service.
37
41
38
42
43
+
44
+
45
+
39
46
``` php
40
47
use App\Service\ProductSearchService
41
48
```
You can’t perform that action at this time.
0 commit comments