Fix Create Relation to self

This commit is contained in:
R
2022-11-15 09:02:36 +07:00
parent 92bce41edc
commit 961be7568d

View File

@@ -141,7 +141,7 @@ class PersonController extends Controller
]);
}
if ($request->has('relation_with_owner')) {
if ($request->has('relation_with_owner') && auth()->user()->person_id != $family->id) {
$family->familyOwner()->updateOrCreate([
'owner_id' => auth()->user()->person_id,
'person_id' => $family->id,