Asad

Updating User role_id in Laravel

Posted 2 months ago by Asad

This is mine Condition i am not filling any form for User Credential i want to do it Hard Coat id this is this then user Role Id shall be changes how can i achieve this

if($pickedPlan="Medium"){
                    $id=Auth::user()->id;
                    $user=User::find($id);
                    $user->role_id=2;
                    $user->save();
         }

I have tried to run this code its not working thanks in Advance

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.