|
|
|
@ -0,0 +1,52 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
namespace App\Admin\Forms; |
|
|
|
|
|
|
|
use Dcat\Admin\Widgets\Form; |
|
|
|
|
|
|
|
class Setting extends Form |
|
|
|
{ |
|
|
|
/** |
|
|
|
* Handle the form request. |
|
|
|
* |
|
|
|
* @param array $input |
|
|
|
* |
|
|
|
* @return mixed |
|
|
|
*/ |
|
|
|
public function handle(array $input) |
|
|
|
{ |
|
|
|
// dump($input);
|
|
|
|
|
|
|
|
// return $this->response()->error('Your error message.');
|
|
|
|
admin_setting($input); |
|
|
|
|
|
|
|
return $this->response()->success('保存成功')->refresh(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Build a form here. |
|
|
|
*/ |
|
|
|
public function form() |
|
|
|
{ |
|
|
|
$this->tab('支付小程序配置', function () { |
|
|
|
$this->text('payee_appid', '收款小程序APPID')->required(); |
|
|
|
$this->text('payee_appsecret', '收款小程序APP_SECRET')->required(); |
|
|
|
$this->text('payee_mchid', '收款小程序MCH_ID')->required(); |
|
|
|
$this->text('payee_mchkey', '收款小程序MCH_KEY')->required(); |
|
|
|
})->tab('小程序服务商配置', function () { |
|
|
|
$this->text('service_appid', '小程序第三方平台APPID'); |
|
|
|
$this->text('service_appsecret', '小程序第三方平台APP_SECRET'); |
|
|
|
$this->text('service_binding_appid', '绑定小程序APPID'); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* The data of the form. |
|
|
|
* |
|
|
|
* @return array |
|
|
|
*/ |
|
|
|
public function default() |
|
|
|
{ |
|
|
|
return admin_setting()->toArray(); |
|
|
|
} |
|
|
|
} |