Package Data | |
---|---|
Maintainer Username: | szp043725449 |
Maintainer Contact: | szp043725449@126.com (sunzhiping) |
Package Create Date: | 2017-01-06 |
Package Last Update: | 2017-05-25 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-19 03:05:46 |
Package Statistics | |
---|---|
Total Downloads: | 47 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Require this package
php composer.phpar require "laravelextends/requestapi:dev-master"
After adding the package, add the ServiceProvider to the providers array in config/app.php
Integration\Api\IntegrationServiceProvider::class,
To publish the config use:
php artisan vendor:publish --tag="config"
php artisan integration:annotaion:create
/**
* @Integration(configure="user.login", power="sdfd", cache={"caching_time":0.5, "cache_name"="ssdf"})
*/
User/abc.php
return [
'parent' => ['user.abc', 'user.sdf'],//继承的配置文件
"responseType" => "json", //html|json
"requestParamters" => [
"token" => [//因为BaseConfig有token所以会继承,如果不写则默认在account_type 后添加
],
"account_type" => [
"validate"=>[
'rules' => "required",
'message'=> ["account_type.required" => ['code'=>'100001', 'message'=>'参数账号类型必填']],
'validate_function'=>function(){
return new SuccessMessage();
},
],
'attached_value' => [
"realParamterName" => "s",
"value" => function(Request $request,
Configure $iconfigure){
$accountType = $request->get('account_type');
return $accountType;
}
]
]
],
];