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