数据保存为数据库中的数组-使用Laravel

时间:2019-07-24 14:31:56

标签: php laravel join

我的代码:

         $name = DB::table('users')
            ->join('user_basic_info','users.id','=','user_basic_info.user_id')
            ->where('user_basic_info.user_id',Auth::user()->id)
             ->pluck('user_basic_info.first_name');


           $userProfile['created_by'] = $name;

我的数据库'created_by'中有一个字段,其保存为[[shahzad“]数组作为字符串,我不知道我在哪里做错了,应该将其保存为字符串的简单名称:

您的帮助将不胜感激!

0 个答案:

没有答案