#### Category : detach

I have two models, Menu and User with many to many relationship. So, at this moment I have lot of records with the same user_id and menu_id in the pivot table, and the user must to can detach only one of them and not all of them. So, I made a AJAX request to "remove" ..

I sent the below value from view to controller: in View: <input type="checkbox" name="Roles[]" value="{{$user->rolesTeams[$i]->pivot}}"/> In Controller: case ‘team-delete’: $input =$request[‘Roles’]; dd($input); Result: array:1 [▼ 0 => "{"user_id":"15","team_id":"2","user_type":"AppUser","role_id":"2"}" ] now How can I make this like:$user = user_id >> which should be 15 $team = team_id >> which whould be 2$role = ..