updateOrCreate([ 'key' => 'kuaidi100', ], ['value' => $input]); return $this ->response() ->success('配置更新成功!') ->refresh(); } /** * Build a form here. */ public function form() { $appSettings = Setting::where('key', 'kuaidi100')->value('value'); $this->switch('is_use', '是否启用')->value($appSettings['is_use'] ?? 0); $this->divider(); $this->text('app_key', 'APP_KEY')->value($appSettings['app_key'] ?? ''); $this->text('customer', 'CUSTOMER')->value($appSettings['customer'] ?? ''); $this->text('secret', 'SECRET')->value($appSettings['secret'] ?? ''); $this->text('userid', 'USER_ID')->value($appSettings['userid'] ?? ''); $this->text('callback_uri', '回调地址(链接)')->value($appSettings['callback_uri'] ?? ''); } }