Hello @titia-sudo
I think you need to change $user->roles()->attach($request->role_id);
to $user->roles()->attach($request->role);
because in your request you call it role and not role_id.
ps. I have updated your post to get clear codeblocks.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community