jqhph / dcat-admin

🔥 基于 Laravel 的后台系统构建工具 (Laravel Admin),使用很少的代码快速构建一个功能完善的高颜值后台系统,内置丰富的后台常用组件,开箱即用,让开发者告别冗杂的HTML代码
http://www.dcatadmin.com
MIT License
3.9k stars 713 forks source link

bug form-input给数组的时候,会报错 #2118

Open aogg opened 6 months ago

aogg commented 6 months ago

给数组,value必定null,这样就到不了array_merge

    /**
     * Get or set input data.
     *
     * @param  string|array  $key
     * @param  mixed  $value
     * @return array|mixed
     */
    public function input($key = null, $value = null)
    {
        if (is_null($key)) {
            return $this->inputs;
        }

        if (is_null($value)) {
            return Arr::get($this->inputs, $key);
        }

        if (is_array($key)) {
            $this->inputs = array_merge($this->inputs, $key);

            return;
        }

        Arr::set($this->inputs, $key, $value);
    }
aogg commented 6 months ago
    {
        "name": "dcat/laravel-admin",
        "version": "2.2.3-beta",
zwping commented 6 months ago

$frorm->text('xxx')->saveAsJson()看看能达到你想要的不

aogg commented 6 months ago

是修改input参数