Deleting a model and all references to it in his relationships in Laravel

I’m still new to Laravel and Eloquent but joining on a project previously built.

I have a User model that have many relationships like for example Actions(HasMany), Roles(BelongsToMany), Type(BelongsTo),..and many others…

What I want to do is to delete an User model and it’s data and when I’m doing it, deleting all traces of him in his relations but not the content itself, basically I want to keep his relations models (Actions, Roles, Type,…) in my database but deleting his FK so that it cannot be linked to my user anymore while keeping the entry previously associated to him.

I tried a few things without success like

$user = User::findOrFail($id)
$user->delete();
// This one giving me a SQLSTATE[23000] The DELETE statement conflicted with the REFERENCE constraint 

$user->actions()->detach()
// or
$user->actions()->dissociate()
// But undefined for HasMany relations

and I was wondering if there was a “clean” and simple way to do it other than updating all those Foreign_Keys to a “NULL” value in each of the relationships

$user->userActions()->update(['id_user' => null]);
$user->userRoles()->update(['id_user' => null]);
//...and on and on... before being able to do a 
$user->delete();

I hope I was clear enough.

Thanks.