我试图将此用户编辑保存到数据库但它无法正常工作

时间:2016-05-18 20:32:55

标签: laravel-5.1

我的模特:

static public function userEddit($request){

   $user = new self();
   $user->name = $request['name'];
   $user->email = $request['email'];
   $user->password = bcrypt($request['password']);
   $user->save();
  DB::insert('INSERT INTO users_role VALUES(' . $user->id .',5)');
}

我的UserContorller

    public function postUser(PostUser $request){
    User::userEddit($request);
    return redirect('shop');
}

0 个答案:

没有答案