I have 2 tables users
and user_info
where the users
id is used in the user_info
user_id column. In order to destroy the one in the users
, I used this command in Controller
$user = User::findOrFail($id);
$user->delete();
I also had to remove the one from the user_info
$userInfo = UserInfo::findOrFail($id);
$userInfo->delete();
But I can't think of the right logic to delete the column that has the user's id
and the user_info's user_id