Laravel – when a foreign key references a primary key in the same table in mysql
In laravel referral system i want two foreign keys(userId,parentId) if user registers using referral code I defined two foreign keys (userId,parentId) in the network table when a user registers with a referral code. It's id, and its parent ID get…