123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <?php
- /*
- |--------------------------------------------------------------------------
- | Prettus Repository Config
- |--------------------------------------------------------------------------
- |
- |
- */
- return [
- /*
- |--------------------------------------------------------------------------
- | Repository Pagination Limit Default
- | 生成器 默认 分页条数
- |--------------------------------------------------------------------------
- |
- */
- 'pagination' => [
- 'limit' => 15
- ],
- /*
- |--------------------------------------------------------------------------
- | Fractal Presenter Config
- |--------------------------------------------------------------------------
- |
- Available serializers:
- ArraySerializer
- DataArraySerializer
- JsonApiSerializer
- */
- 'fractal' => [
- 'params' => [
- 'include' => 'include'
- ],
- 'serializer' => League\Fractal\Serializer\DataArraySerializer::class
- ],
- /*
- |--------------------------------------------------------------------------
- | Cache Config
- |--------------------------------------------------------------------------
- |
- */
- 'cache' => [
- /*
- |--------------------------------------------------------------------------
- | Cache Status
- |--------------------------------------------------------------------------
- |
- | Enable or disable cache
- |
- */
- 'enabled' => true,
- /*
- |--------------------------------------------------------------------------
- | Cache Minutes
- |--------------------------------------------------------------------------
- |
- | Time of expiration cache
- |
- */
- 'minutes' => 30,
- /*
- |--------------------------------------------------------------------------
- | Cache Repository
- |--------------------------------------------------------------------------
- |
- | Instance of Illuminate\Contracts\Cache\Repository
- |
- */
- 'repository' => 'cache',
- /*
- |--------------------------------------------------------------------------
- | Cache Clean Listener
- |--------------------------------------------------------------------------
- |
- |
- |
- */
- 'clean' => [
- /*
- |--------------------------------------------------------------------------
- | Enable clear cache on repository changes
- |--------------------------------------------------------------------------
- |
- */
- 'enabled' => true,
- /*
- |--------------------------------------------------------------------------
- | Actions in Repository
- |--------------------------------------------------------------------------
- |
- | create : Clear Cache on create Entry in repository
- | update : Clear Cache on update Entry in repository
- | delete : Clear Cache on delete Entry in repository
- |
- */
- 'on' => [
- 'create' => true,
- 'update' => true,
- 'delete' => true,
- ]
- ],
- 'params' => [
- /*
- |--------------------------------------------------------------------------
- | Skip Cache Params
- |--------------------------------------------------------------------------
- |
- |
- | Ex: http://prettus.local/?search=lorem&skipCache=true
- |
- */
- 'skipCache' => 'skipCache'
- ],
- /*
- |--------------------------------------------------------------------------
- | Methods Allowed
- |--------------------------------------------------------------------------
- |
- | methods cacheable : all, paginate, find, findByField, findWhere, getByCriteria
- |
- | Ex:
- |
- | 'only' =>['all','paginate'],
- |
- | or
- |
- | 'except' =>['find'],
- */
- 'allowed' => [
- 'only' => null,
- 'except' => null
- ]
- ],
- /*
- |--------------------------------------------------------------------------
- | Criteria Config
- | 过滤条件配置
- |--------------------------------------------------------------------------
- |
- | Settings of request parameters names that will be used by Criteria
- |
- */
- 'criteria' => [
- /*
- |--------------------------------------------------------------------------
- | Accepted Conditions
- |--------------------------------------------------------------------------
- |
- | Conditions accepted in consultations where the Criteria
- |
- | Ex:
- |
- | 'acceptedConditions'=>['=','like']
- |
- | $query->where('foo','=','bar')
- | $query->where('foo','like','bar')
- |
- */
- 'acceptedConditions' => [
- '=',
- 'like'
- ],
- /*
- |--------------------------------------------------------------------------
- | Request Params
- |--------------------------------------------------------------------------
- |
- | Request parameters that will be used to filter the query in the repository
- |
- | Params :
- |
- | - search : Searched value
- | Ex: http://prettus.local/?search=lorem
- |
- | - searchFields : Fields in which research should be carried out
- | Ex:
- | http://prettus.local/?search=lorem&searchFields=name;email
- | http://prettus.local/?search=lorem&searchFields=name:like;email
- | http://prettus.local/?search=lorem&searchFields=name:like
- |
- | - filter : Fields that must be returned to the response object
- | Ex:
- | http://prettus.local/?search=lorem&filter=id,name
- |
- | - orderBy : Order By
- | Ex:
- | http://prettus.local/?search=lorem&orderBy=id
- |
- | - sortedBy : Sort
- | Ex:
- | http://prettus.local/?search=lorem&orderBy=id&sortedBy=asc
- | http://prettus.local/?search=lorem&orderBy=id&sortedBy=desc
- |
- */
- 'params' => [
- 'search' => 'search',
- 'searchFields' => 'searchFields',
- 'filter' => 'filter',
- 'orderBy' => 'orderBy',
- 'sortedBy' => 'sortedBy',
- 'with' => 'with',
- 'searchJoin' => 'searchJoin',
- ]
- ],
- /*
- |--------------------------------------------------------------------------
- | Generator Config
- | 生成器 - 配置
- |--------------------------------------------------------------------------
- |
- */
- 'generator' => [
- 'basePath' => app_path(), //> generator绝对位置如C:\gtSoftware\WWW\blog\app
- 'rootNamespace' => 'App\\', //> generator根命名空间 App\\ 下
- //> 生成器 - paths 参数
- //> key => rootNamespace\\paths.value # 当前Class命名空间
- //> key => basePath/paths.value # 当前Class目录名称 basePath/paths
- 'paths' => [
- 'models' => 'Models', //> 模型 目录/命名空间
- 'repositories' => 'Repositories\\Eloquent', //> 模型 Eloquent 目录
- 'interfaces' => 'Repositories', //> 模型 Eloquent 接口目录
- 'transformers' => 'Transformers', //> 处理Model查询数据
- 'presenters' => 'Presenters', //> 处理Model查询出来的数据
- 'validators' => 'Validators', //> 验证器目录
- 'controllers' => 'Http/Controllers', //> 控制器目录
- 'provider' => 'RepositoryServiceProvider', //> 服务提供者注册目录
- 'criteria' => 'Criteria', //> 查询过滤文件目录
- 'stubsOverridePath' => app_path()
- ]
- ]
- ];
|