okaybueno /
laravel-repositories
| 1 | <?php |
||
| 2 | |||
| 3 | return [ |
||
| 4 | |||
| 5 | /* |
||
| 6 | |-------------------------------------------------------------------------- |
||
| 7 | | Repository interfaces namespace |
||
| 8 | |-------------------------------------------------------------------------- |
||
| 9 | | |
||
| 10 | | You can specify the namespace used in your repositories interfaces. |
||
| 11 | | Once again, I like to put everything under the namespace of my app, |
||
| 12 | | so my repository interfaces usually live under the namespace of my |
||
| 13 | | application: "MyApp\Repositories". |
||
| 14 | | |
||
| 15 | */ |
||
| 16 | 'repository_interfaces_namespace' => 'App\Repositories', |
||
| 17 | |||
| 18 | /* |
||
| 19 | |-------------------------------------------------------------------------- |
||
| 20 | | Criterias namespace |
||
| 21 | |-------------------------------------------------------------------------- |
||
| 22 | | |
||
| 23 | | Please specify the namespace for the criteria. The implementation will |
||
| 24 | | be appended. |
||
| 25 | | |
||
| 26 | */ |
||
| 27 | 'criterias_namespace' => 'App\Repositories\Criteria', |
||
| 28 | |||
| 29 | /* |
||
| 30 | |-------------------------------------------------------------------------- |
||
| 31 | | Base repositories path |
||
| 32 | |-------------------------------------------------------------------------- |
||
| 33 | | |
||
| 34 | | By default the package considers that your interfaces live in |
||
| 35 | | App/Repositories. You can however set this path to whatever value |
||
| 36 | | you want. I personally like to locate all my project files inside a |
||
| 37 | | folder located in "app", something like "app/MyApp/Repositories". |
||
| 38 | | |
||
| 39 | */ |
||
| 40 | 'repositories_path' => app_path('Repositories'), |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 41 | |||
| 42 | /* |
||
| 43 | |-------------------------------------------------------------------------- |
||
| 44 | | Base criteria path |
||
| 45 | |-------------------------------------------------------------------------- |
||
| 46 | | |
||
| 47 | | Your criteria needs to live somewhere, so please specify here the base |
||
| 48 | | path of your criteria. Skip the implementation. |
||
| 49 | | |
||
| 50 | */ |
||
| 51 | 'criterias_path' => app_path('Repositories/Criteria'), |
||
| 52 | |||
| 53 | /* |
||
| 54 | |-------------------------------------------------------------------------- |
||
| 55 | | Implementation bindings |
||
| 56 | |-------------------------------------------------------------------------- |
||
| 57 | | |
||
| 58 | | As we can have same interface but different implementations that support |
||
| 59 | | our repositories, we can define the implementation that we want to use for |
||
| 60 | | each of the repositories that we have in our application. By default, |
||
| 61 | | Eloquent is used. Sometimes you might find cases where you have to |
||
| 62 | | support several data-stores (like MariaDB, MongoDB and PostgreSQL) at the |
||
| 63 | | same time. Although this package supports only Eloquent now, the plan is |
||
| 64 | | to add more engines/ORMs/data-stores, so I want to keep this flexible. |
||
| 65 | | |
||
| 66 | | In this configuration setting you can specific which repository should |
||
| 67 | | resolve to each engine. You can't have the same repository bind to more |
||
| 68 | | than one engine, but you can have different repositories bind to different |
||
| 69 | | engines. |
||
| 70 | | |
||
| 71 | | All the repository interfaces not bind will be bind to the default |
||
| 72 | | engine. |
||
| 73 | | |
||
| 74 | | Values supported: 'default', array of repository interface names. |
||
| 75 | | |
||
| 76 | */ |
||
| 77 | 'bindings' => [ |
||
| 78 | 'eloquent' => 'default', |
||
| 79 | // 'eloquent' => [ |
||
| 80 | // 'UserRepositoryInterface', |
||
| 81 | // 'PostRepositoryInterface' |
||
| 82 | // ] |
||
| 83 | ], |
||
| 84 | |||
| 85 | /* |
||
| 86 | |-------------------------------------------------------------------------- |
||
| 87 | | Skip repositories |
||
| 88 | |-------------------------------------------------------------------------- |
||
| 89 | | |
||
| 90 | | Sometimes you may wish to skip the auto-binding of some repositories. |
||
| 91 | | You can specify here what of those INTERFACES should be skipped from the |
||
| 92 | | auto-binder. You must specify the name of the file, as the skip happens |
||
| 93 | | when scanning the repositories. |
||
| 94 | | |
||
| 95 | */ |
||
| 96 | 'skip' => [ |
||
| 97 | 'BaseRepositoryInterface' |
||
| 98 | ], |
||
| 99 | |||
| 100 | /* |
||
| 101 | |-------------------------------------------------------------------------- |
||
| 102 | | Supported implementations |
||
| 103 | |-------------------------------------------------------------------------- |
||
| 104 | | |
||
| 105 | | Array with the supported implementations. This allow you to extend the |
||
| 106 | | package to your needs. |
||
| 107 | | |
||
| 108 | */ |
||
| 109 | 'supported_implementations' => [ |
||
| 110 | 'eloquent' => \OkayBueno\Repositories\src\EloquentRepository::class, |
||
| 111 | ] |
||
| 112 | |||
| 113 | ]; |