简体   繁体   English

提交表单时出现“ErrorException 数组到字符串的转换”

[英]"ErrorException Array to string conversion" when submitting a form

I am trying to submit a form but it showed me "ErrorException Array to string conversion" in line generalForm::create($input);我正在尝试提交表单,但它在generalForm::create($input);行中向我显示“ErrorException Array to string conversion”

    public function store(Request $request)
    {
        $input = $request->all();
        $input['services'] = $request->input('services');
        $input['needs'] = $request->input('needs');
        generalForm::create($input);
        return redirect()->route('/');  
    }

when you use $input = $request->all();当你使用$input = $request->all(); , data is array and contain array of services, so you can store in directly if services filed exists on db and is array ,数据是数组,包含服务数组,所以如果服务文件存在于db上并且是数组,则可以直接存储

generalForm::create($input);
return redirect()->route('/');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ErrorException [注意]:数组到字符串转换PHP表单 - ErrorException [Notice]:Array to string conversion PHP Form 带有转发器字段的 Laravel 表单提交中的 ErrorException 数组到字符串转换 - ErrorException Array to string conversion in Laravel form submission with repeater fields ErrorException:PHP中的数组到字符串的转换 - ErrorException : Array to string conversion in PHP 迁移--seed时将ErrorException数组转换为字符串 - ErrorException array to string conversion on migrate --seed ErrorException 数组到 Controller 文件中的字符串转换 - ErrorException Array to string conversion in Controller file PHP公告– yii \\ base \\ ErrorException(数组到字符串的转换)Yii - PHP Notice – yii\base\ErrorException (Array to string conversion) Yii 在 laravel 中上传图像时数组到字符串转换 ErrorException - Array to string conversion ErrorException while uploading image in laravel 7 ErrorException 数组到字符串的转换 Laravel - 将 JSON 导入到 MySQL - ErrorException Array to string conversion Laravel - Importing JSON to MySQL Laravel 中的 ErrorException (E_NOTICE) 数组到字符串的转换 - ErrorException (E_NOTICE) Array to string conversion in Laravel 使用Laravel和Lang :: get()进行代码接收“ ErrorException数组到字符串的转换” - Codeception “ErrorException array to string conversion” with Laravel and Lang::get()
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM